Created
February 5, 2018 15:42
-
-
Save ironhouzi/ddc240da030706e31da9de2dfc2e716c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name mysite.com; | |
location /.foo { | |
alias /opt/foo; | |
try_files $uri @proxy; | |
} | |
location @proxy { | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $remote_addr; | |
proxy_set_header Host $host; | |
proxy_pass http://internal-proxy; | |
proxy_http_version 1.1; | |
proxy_buffering off; | |
proxy_buffer_size 4k; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name mysite.com; | |
location /.foo { | |
root /opt; | |
} | |
location / { | |
root /opt/root; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user nginx; | |
worker_processes 1; | |
error_log /var/log/nginx/error.log warn; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include /etc/nginx/mime.types; | |
default_type application/octet-stream; | |
sendfile on; | |
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | |
'$status $body_bytes_sent "$http_referer" ' | |
'"$http_user_agent" "$http_x_forwarded_for"'; | |
access_log /var/log/nginx/access.log main; | |
keepalive_timeout 3000; | |
client_max_body_size 0; | |
include /etc/nginx/conf.d/*.conf; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Proxies executed as containers:
I create files on both proxies:
http://mysite.com:8888/.foo/
returns:FOO
andhttp://mysite.com:8888/.foo/index.html
returnsFOOBAR
.