Welcome! Log In Create A New Profile

Advanced

Pseudo-Reverse-Proxy

Posted by Tommy2015 
Pseudo-Reverse-Proxy
January 27, 2015 01:55PM
Hi, I'd like to reach my regular http-site additionally over a https-reverse-proxy-nginx-setup over another domain. If a visitor visits "https://proxy.com" he actually sees "http://mysite.com", the address in the browser does not matter BUT if the visitor on the site posts links/images etc. via social media links to e.g. Facebook the url posted MUST be "http://mysite.com".

With the configuration below it almost works (visitors stay on the proxy site and use the backend site) but I have to disable the "subs_filter" rule since then ALL urls are getting rewritten, even the one for social media. What must be changed, how? Thank you for any hints!

server {
listen 443 ssl;
server_name proxy.com;
access_log /opt/nginx/logs/proxy-com-access.log;
ssl on;
ssl_certificate /opt/nginx/cert/proxy-com.crt;
ssl_certificate_key /opt/nginx/cert/proxy-com.key;

location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host mysite.com;
proxy_redirect off;

proxy_pass http://mysite.com/;
proxy_redirect http:// https://;
proxy_set_header Accept-Encoding "";
subs_filter_types * */* text/html text/css text/xml;
#subs_filter 'http://mysite.com' 'https://proxy.com' gi;
}
}
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 323
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready