Update Section_06/reverse_proxy, Section_06/reverse_proxy.sh, Section_06/reverse_proxy.conf
This commit is contained in:
parent
b81d31adac
commit
9aeeffff9f
21
Section_06/reverse_proxy
Normal file
21
Section_06/reverse_proxy
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://127.0.0.1:5000;
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header X-Forwarded-Host $http_host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto http;
|
||||||
|
proxy_set_header X-Forwarded-Port 80;
|
||||||
|
proxy_buffer_size 128k;
|
||||||
|
proxy_buffers 4 256k;
|
||||||
|
proxy_busy_buffers_size 256k;
|
||||||
|
}
|
||||||
|
|
||||||
|
access_log /var/log/nginx/reverse_proxy_nginx.log;
|
||||||
|
error_log /var/log/nginx/reverse_proxy_nginx.log;
|
||||||
|
}
|
@ -9,6 +9,6 @@
|
|||||||
|
|
||||||
ProxyRequests Off
|
ProxyRequests Off
|
||||||
ProxyPreserveHost On
|
ProxyPreserveHost On
|
||||||
ProxyPass / https://127.0.0.1:5000/
|
ProxyPass / http://localhost:5000/
|
||||||
ProxyPassReverse / https://127.0.0.1:5000/
|
ProxyPassReverse / http://localhost:5000/
|
||||||
</VirtualHost>
|
</VirtualHost>
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
# Apache2
|
# Apache2
|
||||||
sudo systemctl enable apache2 --now
|
sudo systemctl enable apache2 --now
|
||||||
|
sudo a2enmod proxy proxy_http proxy_ajp rewrite deflate headers proxy_balancer proxy_connect proxy_html
|
||||||
|
sudo systemctl restart apache2
|
||||||
cd /etc/apache2/sites-available/
|
cd /etc/apache2/sites-available/
|
||||||
sudo nano reverse_proxy.conf
|
sudo nano reverse_proxy.conf
|
||||||
sudo a2dissite 000-default
|
sudo a2dissite 000-default
|
||||||
|
Loading…
x
Reference in New Issue
Block a user