反向代理
复制代码
- server {
- listen 80;
- server_name zt.h.com;
- location / {
- proxy_pass http://127.0.0.1:9000;
- index index.html index.htm;
- }
- }
php网站配置
复制代码
- server{
- listen 80;
- server_name baidu120.p.com;
- root E:/wwwroot/baidu120;
- index index.php default.php index.html index.htm default.html default.htm;
-
- error_page 404 /404.html;
- error_page 502 /502.html;
-
- location ~ \.php {
-
- root E:/wwwroot/baidu120;
- fastcgi_pass 127.0.0.1:8000;
- fastcgi_index index.php;
- fastcgi_split_path_info ^(.+\.php)(.*)$;
- fastcgi_param PATH_INFO $fastcgi_path_info;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params;
- }
-
- location / {
- try_files $uri $uri/ /index.php?$query_string;
- }
- }
评论已关闭