Welcome! Log In Create A New Profile

Advanced

PHP Pages

Posted by mdm100 
mdm100
PHP Pages
May 23, 2018 10:30PM
My nginx vhost setup will serve .html files but it throws the 503 Bad
Gateway error when trying to serve a .php file.

This server runs Laravel vhost with not issue, it just will not run plain
..php files.

Server: Ubuntu 17

server {
listen 80;
listen [::]:80;

server_name convergeone.hudsonstreet.us;

root /var/www/html/convergeone;
index index.html index.php;

location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
include fastcgi_params;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_param SCRIPT_FILENAME
/var/www/html/example.com/public_html$fastcgi_script_name;
}
}

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,279936,279936#msg-279936

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
mdm100
Re: PHP Pages
May 23, 2018 10:40PM
mdm100 Wrote:
-------------------------------------------------------
> My nginx vhost setup will serve .html files but it throws the 502 Bad
Gateway
>nginx/1.12.1 (Ubuntu)

> Gateway error when trying to serve a .php file.
>
> This server runs Laravel vhost with not issue, it just will not run
> plain .php files.
>
> Server: Ubuntu 17
>
> server {
> listen 80;
> listen [::]:80;
>
> server_name convergeone.hudsonstreet.us;
>
> root /var/www/html/convergeone;
> index index.html index.php;
>
> location / {
> try_files $uri $uri/ =404;
> }
> location ~ \.php$ {
> include snippets/fastcgi-php.conf;
> include fastcgi_params;
> fastcgi_pass unix:/run/php/php7.0-fpm.sock;
> fastcgi_param SCRIPT_FILENAME
> /var/www/html/example.com/convergeone$fastcgi_script_name;
> }
> }

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,279936,279937#msg-279937

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
mdm100
Re: PHP Pages
May 23, 2018 10:40PM
mdm100 Wrote:
-------------------------------------------------------
mdm100 Wrote:
-------------------------------------------------------
My nginx vhost setup will serve .html files but it throws the 502
Bad Gateway
nginx/1.12.1 (Ubuntu)

Gateway error when trying to serve a .php file.
This server runs Laravel vhost with not issue, it just will not run
plain .php files.

Server: Ubuntu 17

server {
listen 80;
listen [::]:80;

server_name convergeone.hudsonstreet.us;

root /var/www/html/convergeone;
index index.html index.php;

location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
include fastcgi_params;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_param SCRIPT_FILENAME
/var/www/html/example.com/convergeone$fastcgi_script_name;
}
}

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,279936,279938#msg-279938

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Aleksandar Lazic
Re: PHP Pages
May 23, 2018 10:40PM
Hi.

On 23/05/2018 16:27, mdm100 wrote:
>My nginx vhost setup will serve .html files but it throws the 503 Bad
>Gateway error when trying to serve a .php file.
>
>This server runs Laravel vhost with not issue, it just will not run plain
>.php files.
>
>Server: Ubuntu 17
>
>server {
> listen 80;
> listen [::]:80;
>
> server_name convergeone.hudsonstreet.us;
>
> root /var/www/html/convergeone;
> index index.html index.php;
>
> location / {
> try_files $uri $uri/ =404;
> }
> location ~ \.php$ {
> include snippets/fastcgi-php.conf;

What's in this file?

> include fastcgi_params;
> fastcgi_pass unix:/run/php/php7.0-fpm.sock;
> fastcgi_param SCRIPT_FILENAME
>/var/www/html/example.com/public_html$fastcgi_script_name;
> }
>}

What's in the error log of nginx and php?

Maybe this config is worth to take a look?

https://stackoverflow.com/questions/8856664/setting-up-laravel-with-nginx

Best regards
aleks

>Posted at Nginx Forum: https://forum.nginx.org/read.php?2,279936,279936#msg-279936
>
>_______________________________________________
>nginx mailing list
>[email protected]
>http://mailman.nginx.org/mailman/listinfo/nginx
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Sorry, only registered users may post in this forum.

Click here to login