# 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>
/* other configuration for nginx:
server {
listen 80;
server_name example.com *.example.com;
location / {
proxy_pass http://127.0.0.1:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
*/
Proxy reverse:
let you point web folders to other server/ports.
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.