Welcome! Log In Create A New Profile


Nginx - Reverse Proxy - Session closed

Posted by XEmme 
Nginx - Reverse Proxy - Session closed
November 13, 2018 08:48AM
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?
Re: Nginx - Reverse Proxy - Session closed
November 15, 2018 05:09AM
Just solved deleting "proxy_set_header Host $host;" string
Now I have some issue with frames that nginx doesn't allow me to view :-/
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 83
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready