Hi all,
I just setup nginx to work as reverse proxy in order to publish an internal website.
I used this vhost configuration:
server {
# The IP that you forwarded in your router (nginx proxy)
listen **********:80 default_server;
# Make site accessible from http://localhost/
server_name www.mydomain.com;
# The internal IP of the VM that hosts your Apache config
# set $upstream ***_internal_website_IP_***;
location / {
proxy_pass_header Server;
proxy_cache STATIC;
proxy_cache_valid 200 1d;
proxy_cache_use_stale error timeout invalid_header updating
http_500 http_502 http_503 http_504;
proxy_pass http://**_internal_website_FQDN***/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_buffering off;
client_max_body_size 0;
proxy_read_timeout 36000s;
proxy_redirect http://**_internal_website_FQDN***/ http://$host/;
sub_filter "http://**_internal_website_FQDN***/" "http://www.mydomain.com/";
sub_filter_once off;
sub_filter_types *;
}
}
I can access internal website, but when I use credentials to log in, it loads and then after few seconds brings me back to the home page.
It seems there's something wrong with sessions.
Any hints?
I just setup nginx to work as reverse proxy in order to publish an internal website.
I used this vhost configuration:
server {
# The IP that you forwarded in your router (nginx proxy)
listen **********:80 default_server;
# Make site accessible from http://localhost/
server_name www.mydomain.com;
# The internal IP of the VM that hosts your Apache config
# set $upstream ***_internal_website_IP_***;
location / {
proxy_pass_header Server;
proxy_cache STATIC;
proxy_cache_valid 200 1d;
proxy_cache_use_stale error timeout invalid_header updating
http_500 http_502 http_503 http_504;
proxy_pass http://**_internal_website_FQDN***/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_buffering off;
client_max_body_size 0;
proxy_read_timeout 36000s;
proxy_redirect http://**_internal_website_FQDN***/ http://$host/;
sub_filter "http://**_internal_website_FQDN***/" "http://www.mydomain.com/";
sub_filter_once off;
sub_filter_types *;
}
}
I can access internal website, but when I use credentials to log in, it loads and then after few seconds brings me back to the home page.
It seems there's something wrong with sessions.
Any hints?