soydepr
Posts: 118
Joined: Mon Mar 24, 2014 10:51 am

nginx 504 gateway time out

Sat Sep 22, 2018 3:12 am

where is this file located
But, you should also change set request_terminate_timeout parameter (commented by default) at www.conf file from PHP-FPM:

following this https://www.scalescale.com/tips/nginx/5 ... ing-nginx/

pico -w /etc/php-fpm.d/www.conf not in raspbian ?


soydepr
Posts: 118
Joined: Mon Mar 24, 2014 10:51 am

Re: nginx 504 gateway time out

Sat Sep 22, 2018 10:42 am

thanks

is nginx really better than lighttpd?

now im getting 404 after adjusting all parameters wtf i think im going back to lighty

Heater
Posts: 9840
Joined: Tue Jul 17, 2012 3:02 pm

Re: nginx 504 gateway time out

Sat Sep 22, 2018 12:11 pm

nginx is very good. Is it better? That depends what you want to do.

404 is a Not Found error that you are likely to get with nginx or any other web server. You sure you have the right URLs, your files in the right places etc?

soydepr
Posts: 118
Joined: Mon Mar 24, 2014 10:51 am

Re: nginx 504 gateway time out

Sat Sep 22, 2018 12:48 pm

yes files in place. i retried with lighttpd and no issues .
i really want to switch as owncloud does not support lighty but is working for me not sure why nginx does not find it

User avatar
DougieLawson
Posts: 33827
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: nginx 504 gateway time out

Sat Sep 22, 2018 9:34 pm

What do you have in /etc/nginx/sites-enabled/default?

Code: Select all

# You may add here your
# server {
#       ...
# }
# statements for each of your virtual hosts to this file

##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

server {
        #listen   80; ## listen for ipv4; this line is default and implied
        listen   [::]:80 default_server ipv6only=off; ## listen for ipv6

        root /srv/www/httpi;
        index index.html index.htm;

        # Make site accessible from http://localhost/
        server_name viking;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ /index.html;
                # Uncomment to enable naxsi on this location
                # include /etc/nginx/naxsi.rules
        }

        location /doc/ {
                alias /usr/share/doc/;
                autoindex on;
                allow 127.0.0.1;
                allow ::1;
                deny all;
        }

        # Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests
        #location /RequestDenied {
        #       proxy_pass http://127.0.0.1:8080;
        #}

        #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/share/nginx/www;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
        #       # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
        #
        #       # With php5-cgi alone:
        #       fastcgi_pass 127.0.0.1:9000;
                # With php5-fpm:
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #       deny all;
        #}
   location /cgi-bin/ {
     # Disable gzip (it makes scripts feel slower since they have to complete
     # before getting gzipped)
     gzip off;
     # Set the root to /usr/lib (inside this location this means that we are
     # giving access to the files under /usr/lib/cgi-bin)
     root  /srv/www/httpi;
     # Fastcgi socket
     # Fastcgi parameters, include the standard ones
     include /etc/nginx/fastcgi_params;
     fastcgi_pass  unix:/var/run/fcgiwrap.socket;
     # Adjust non standard parameters (SCRIPT_FILENAME)
#     fastcgi_param SCRIPT_FILENAME  $document_root$fastcgi_script_name;
   }
}


# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
#       listen 8000;
#       listen somename:8080;
#       server_name somename alias another.alias;
#       root html;
#       index index.html index.htm;
#
#       location / {
#               try_files $uri $uri/ =404;
#       }
#}


# HTTPS server
#
server {
        listen 443;
        server_name aplus;

        root /var/www/html;
        index index.html index.htm;

        ssl on;
        ssl_certificate /etc/nginx/conf.d/certs/postgresql.pem;
        ssl_certificate_key /etc/nginx/conf.d/certs/postgresql.key;

        ssl_session_timeout 5m;

        ssl_protocols SSLv3 TLSv1;
        ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
        ssl_prefer_server_ciphers on;

        location / {
                try_files $uri $uri/ =404;
        }
 }
The root directive defines the document root directory for the server.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

soydepr
Posts: 118
Joined: Mon Mar 24, 2014 10:51 am

Re: nginx 504 gateway time out

Sun Sep 23, 2018 12:23 am

/var/www/html/

Heater
Posts: 9840
Joined: Tue Jul 17, 2012 3:02 pm

Re: nginx 504 gateway time out

Sun Sep 23, 2018 5:08 am

/var/www/html/ sounds right to me. That's what I have seen out of the box with nginx installs on Raspbian/Debian.

Of course you can always change it if you need to.

Return to “General discussion”

Who is online

Users browsing this forum: davidcoton and 49 guests