分类
未分类

nginx 添加虚拟站点

server {
listen 80;
listen [::]:80;
server_name www.hsueh.cn;
root /var/www/hsueh.cn;

# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;

location / {
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$args;
}

# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;

location ~ \.php$ {
root /var/www/hsueh.cn;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

error_page 404 /404.html;
location = /40x.html {
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}

发表评论

电子邮件地址不会被公开。 必填项已用*标注