Question
Global Nginx conf breaks the server
I have a Ubuntu 16.04 droplet: It’s a pure all-default LEMP environment.
I’ve added the following global conf to the http
block inside nginx.conf
.
The purpose is to cover app all apps (WordPress apps and PHPmyadmin) in one block of conf, instead creating multiple conf files and their symlinks.
http {
..........................................
server {
listen 80 default_server;
root /var/www/$host;
location / {
index index.php index.html index.htm;
}
location {
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
..........................................
}
The problem is that this configuration breaks the system - as long as it’s inside nginx.conf
, the system breaks.
The full nginx.conf
can be seen here.
Why does my global code breaks Nginx?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×