Welcome! Log In Create A New Profile

Advanced

Reverse proxy

Posted by ChMuX 
Reverse proxy
November 29, 2017 09:03AM
Hi everybody,

I have a problem, I want to use nginx as a reverse proxy.
My lan server is reachable by https://test.mydomain.lan/rococo and I want to access it by https://work.rococo.com.

My config file is :
server {
listen 443 ssl;
server_name work.rococo.com;

ssl_certificate /etc/nginx/ssl/rococo.com/rococo.com.crt;
ssl_certificate_key /etc/nginx/ssl/rococo.com/rococo.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM;
ssl_verify_client off;

# gestion des logs
access_log /var/log/nginx/rococo.com_access.log;
error_log /var/log/nginx/rococo.com_error.log;

location ~ /\. {
deny all;
access_log off;
log_not_found off;
}

location / {
allow all;
proxy_pass https://test.mydomain.lan;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
sub_filter_types text/html application/x-javascript;
sub_filter 'https://test.mydomain.lan:443' 'https://test.mydomain.lan/rococo';
sub_filter 'https:\u002f\u002ftest.mydomain.lan:443' 'https://test.mydomain.lan/rococo';
sub_filter 'test.mydomain.lan:443' 'work.rococo.com';
sub_filter_once off;
}
}


This file config doesn't work. Have you an idea?

Thank you for your help
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 111
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