Answer the question
In order to leave comments, you need to log in
How to make a universal nginx site config?
server {
listen 80 default_server;
listen [::]:80 default_server;
root /home/alexey/sites/$http_host;
index index.php index.html index.htm index.nginx-debian.html;
server_name $http_host;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
}
location ~ /\.ht {
deny all;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question