Nginx reverse proxy Apache pseudo-static

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;
  }
}

I want to reverse proxy from port 80 of nginx to port 8080 of apache. How can I achieve the pseudo-static of .php?

It is not necessary to use nginx instead of Apache under

Windows
because the efficiency of nginx under Windows is low, so it is not recommended to be used in production environment
just use Apache to run php and static

Menu