Skip to content

Instantly share code, notes, and snippets.

@magnusdahlstrand
Created January 10, 2017 19:05
Show Gist options
  • Save magnusdahlstrand/8e3109ad8e30979a55d82a1e55cda1d4 to your computer and use it in GitHub Desktop.
Save magnusdahlstrand/8e3109ad8e30979a55d82a1e55cda1d4 to your computer and use it in GitHub Desktop.
nginx configuration to forward requests to apache if there's no nginx server block handling the specific request
server {
listen 8999 default_server;
server_name _;
location / {
# return 418; #teacup for test
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8080;
}
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment