1. 程式人生 > >nginx 繫結域名(centos linux)

nginx 繫結域名(centos linux)


server {
listen 80;               #監聽的埠號
server_name websuitA.com;        #域名
#access_log logs/host.access.log main;
location / {
root X:/wnmp/www/websuitA;    #站點的路徑
index default.php index.php index.html index.htm;
#站點的rewrite在這裡寫
rewrite ^/(\w+)\.html$ /$1.php;
rewrite ^/(\w+)/(\w+)$ /$1/$2.php;
}
#錯誤頁的配置
error_page 404 /error.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
root X:/wnmp/www/websuitA;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}