连续复制
一键复制

反向代理

复制代码
  1. server {
  2. listen 80;
  3. server_name zt.h.com;
  4. location / {
  5. proxy_pass http://127.0.0.1:9000;
  6. index index.html index.htm;
  7. }
  8. }

php网站配置

复制代码
  1. server{
  2. listen 80;
  3. server_name baidu120.p.com;
  4. root E:/wwwroot/baidu120;
  5. index index.php default.php index.html index.htm default.html default.htm;
  6. #error_page 404/404.html;
  7. error_page 404 /404.html;
  8. error_page 502 /502.html;
  9. location ~ \.php {
  10. #去掉$
  11. root E:/wwwroot/baidu120;
  12. fastcgi_pass 127.0.0.1:8000;
  13. fastcgi_index index.php;
  14. fastcgi_split_path_info ^(.+\.php)(.*)$; #增加这一句
  15. fastcgi_param PATH_INFO $fastcgi_path_info; #增加这一句
  16. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  17. include fastcgi_params;
  18. }
  19. location / {
  20. try_files $uri $uri/ /index.php?$query_string;
  21. }
  22. }