Proxy reversible

# NGINX: add <folder> in /etc/nginx/sites-available/default: server { : location /<folder>/ { proxy_pass http://<host>:<port>/; proxy_set_header X-Original-Host $http_host; proxy_set_header X-Original-Scheme $scheme; proxy_set_header X-Forwarded-For $remote_addr; } : } # APACHE2: add <folder> in /etc/apache2/sites-available/00-default.conf <VirtualHost *:80> : ProxyPass /<folder> http://<host>:<port>/ ProxyPassReverse /<folder> http://<host>:<port>/ ProxyRequests Off ProxyPreserveHost On <proxy> Order deny,allow Allow from all </proxy> : </VirtualHost> #examples: folder "http://192.168.11.45/demo -> http://192.168.11.45:8080/" server { : location /demo/ { proxy_pass http://localhost:8080/; proxy_set_header X-Original-Host $http_host; proxy_set_header X-Original-Scheme $scheme; proxy_set_header X-Forwarded-For $remote_addr; } : } <VirtualHost *:80> : ProxyPass /demo http://localhost:8080/ ProxyPassReverse /demo http://localhost:8080/ ProxyRequests Off ProxyPreserveHost On <proxy> Order deny,allow Allow from all </proxy> : </VirtualHost>
Proxy reverse:

let you point web folders to other server/ports.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.