鍍金池/ 問(wèn)答/Linux  網(wǎng)絡(luò)安全/ nginx反向代理Apache偽靜態(tài)

nginx反向代理Apache偽靜態(tài)

server {
  listen       80;
  server_name  test.com;
  root   "D:/test.com/";
  location / {
    index  index.html index.htm index.php;
  }
  location ~ \.php(.*)$ {
    rewrite ^/(.*)$ index.php/$1 break;
    proxy_set_header  Host $host;
    proxy_set_header  X-Real-IP  $remote_addr;
    proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass  http://test.com:8080;
  }
}

我想通過(guò)nginx的80端口反向代理到apache的8080端口,怎么實(shí)現(xiàn).php的偽靜態(tài)呢?

回答
編輯回答
傻丟丟

Windows下沒(méi)必要用nginx反代Apache
因?yàn)閃indows下的nginx效率較低,不建議用于生產(chǎn)環(huán)境
直接用Apache跑php和靜態(tài)就行

2017年10月20日 07:34