server {
listen 80;
server_name example.com;
error_log /srv/www/sites/example.com/logs/error.log info;
access_log /srv/www/sites/example.com/logs/access.log;
root /srv/www/sites/example.com/htdocs/;
index index.html index.htm index.php;
location ~ \.php$ {
fastcgi_pass unix:/run/php-fpm/example.com.socket;
fastcgi_index index.php;
include fastcgi.conf;
fastcgi_param SCRIPT_FILENAME /htdocs$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT /htdocs;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
}
Все виртуальные хосты имеют вид:
listen 80;
server_name example.com www.example.com;
Один из них случаешь еще и 443.
Дефолтный:
listen *:80 default_server;
listen [::]:80 default_server;
server_name _;