Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Problem z nginx...


Rekomendowane odpowiedzi

Opublikowano

Witam, mam duży problem z nginx. Otóż wczoraj je zainstalowałem no i doinstalowałem php55 + php55 extesion czy jak to się tam pisze, no i wchodząc na stronę (mojeip/index.html) mam takie coś:

 

5831114572624601228468.jpegCzy ja wejde na to z pc czy telefonu mam to samo. Pliki się mieszczą w folderze:

/usr/local/www/nginx-dist/

 

Za pomoc, daję lajki.

 

Opublikowano

 

 

Pokaz /usr/local/etc/nginx/nginx.conf

http://wklej.to/MxXHj

Daj inny link bo nie dziala mi cos wklej.to

 

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   /usr/local/www/nginx;
            index  index.html index.htm;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/local/www/nginx-dist;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}
Opublikowano

A wiec tak:

Usun to

server_name  localhost

chmod 777 na folder /usr/local/www/nginx

i restart 

service nginx restart 
jesli nie dziala to
/usr/local/etc/rc.d/nginx restart

ban.gif

 

Opublikowano

 

A wiec tak:

Usun to

server_name  localhost

chmod 777 na folder /usr/local/www/nginx

i restart 

service nginx restart 
jesli nie dziala to
/usr/local/etc/rc.d/nginx restart

Dzięki działa, tylko mam jeden problem. Możesz mi powiedzieć, co ja mam zrobić, aby mi obsługiwało .php? bo jak wpisuję moje_ip/index.php to pliczek php mi się pobiera a jak piszę .html to działa normalnie.

Opublikowano

pod

 location / {
            root   /usr/local/www/nginx;
            index  index.html index.htm;
        }

dodaj

location ~ \.php(?:$|/) {
				fastcgi_split_path_info ^(.+\.php)(/.*)$;
				fastcgi_pass unix:/var/run/php-fpm.sock;
				fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
				fastcgi_param PATH_INFO $fastcgi_path_info;
				fastcgi_param HTTPS on;
				include fastcgi_params;
				fastcgi_param modHeadersAvailable true;
				fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on;
			}

+ do rc.conf dodaj 

 
php_fpm_enable="YES"

ban.gif

 

Opublikowano

 @alchemik1

 

pod

 location / {
            root   /usr/local/www/nginx;
            index  index.html index.htm;
        }

dodaj

location ~ \.php(?:$|/) {
				fastcgi_split_path_info ^(.+\.php)(/.*)$;
				fastcgi_pass unix:/var/run/php-fpm.sock;
				fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
				fastcgi_param PATH_INFO $fastcgi_path_info;
				fastcgi_param HTTPS on;
				include fastcgi_params;
				fastcgi_param modHeadersAvailable true;
				fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on;
			}

+ do rc.conf dodaj 

 
php_fpm_enable="YES"

 

pisze mi 404 not found :/

Opublikowano

Po gówno walić się z tym posranym dziadostwem, zainstaluj apache i będzie śmigało bez problemu.

Jesli wedlug ciebie nginx jest dziadostwem, a apache jest z*******e to az kisne z ciebie i twojej prymitywnego myslenia. 

Temat i tak jest nie aktualny bo autor nie ma juz problemu z nginx

ban.gif

 

  • 2 tygodnie później...

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...