0

I am running an app in a docker container with nginx in front as a load-balancer. I would like to pass all the traffic to the app except one with following URL pattern

https://mydomain/peek/somepage.php

The following nginx config renders https://mydomain/peek/somepage.html from the folder peek but not somepage.php because I don't know how to write configuration for fastcgi to process the php files in this particular location.

upstream discourse {
 server 127.0.0.1:8080;
 }

location ^~ /peek {
        alias /home/forge/domain_name/public/peek;
}

location / {
         include proxy_params;
         proxy_pass http://discourse;
         proxy_redirect off; proxy_http_version 1.1;
         proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade";
        }

Can someone please help?

0

Duplicate of this question.

location /mydomain/peek/somepage.php {
  return 404;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.