Welcome! Log In Create A New Profile

Advanced

NGINX Proxy pass problem I think!

Posted by gh0stid 
NGINX Proxy pass problem I think!
October 19, 2017 04:07PM
Hello first of all .. sorry to bother you all!

second, ive been struggling the last 6 hours on that configuration ...
we moved from an environement to another, so it seem ot be DNS issues...

heres the backgroup and config

Somebody updated the nginx config ( behind docker ) without making proper backup ( ok .. its me )
now im struggling , the website should have that structure ..

siemwebsite.portal.siem.local
siemwebsite.z06.rezz.qc.ca

all of my hosts files are ok and dns entry correct too.. With that config I get connection refused
Please... HELP ME. and once again, sorry to bother .. must be real dumb question, but what can I say, im lost atm ...


server {
server_name ~^(?<stack>[^.]+)\.[a-z0-9-]+\.[a-z0-9-]+\.[a-z0-9-]+\.[a-z]+\.[a-z]+$$;
resolver 169.254.169.250 valid=2s ipv6=off;
set $$hostpass "siemonster";
location / {
proxy_pass http://$$hostpass;
proxy_set_header Accept-Encoding "";
proxy_set_header Host $$host;
proxy_set_header X-Real-IP $$remote_addr;
proxy_set_header Upgrade $$http_upgrade;
proxy_set_header Connection "upgrade";
}
}
server {
server_name msa.*;
resolver 169.254.169.250 valid=2s ipv6=off;
set $$hostpass "msa";
location / {
proxy_pass http://$$hostpass;
proxy_set_header Accept-Encoding "";
proxy_set_header Host $$host;
proxy_set_header X-Real-IP $$remote_addr;
proxy_set_header Upgrade $$http_upgrade;
proxy_set_header Connection "upgrade";
}
}

server {
server_name admin.*;
resolver 169.254.169.250 valid=2s ipv6=off;
set $$hostpass "admin";
location / {
proxy_pass http://$$hostpass;
proxy_set_header Accept-Encoding "";
proxy_set_header Host $$host;
proxy_set_header X-Real-IP $$remote_addr;
proxy_set_header Upgrade $$http_upgrade;
proxy_set_header Connection "upgrade";
}
}

server {
server_name 411.*;
resolver 169.254.169.250 valid=2s ipv6=off;
set $$hostpass "411";
location / {
sub_filter </head> '</head><script>window.addEventListener("message", function(event){ if( event.origin.match(/^https?:\/\/(localhost(:\d+)?|(app.)?${SITE_DNAME})/) ) eval(event.data);}, false); if(window == top)top.location = "//${SITE_DNAME}/#/welcome";</script>';
sub_filter_once on;
sub_filter_types *;
proxy_pass http://$$hostpass;
proxy_set_header Accept-Encoding "";
proxy_set_header Host $$host;
proxy_set_header X-Real-IP $$remote_addr;
proxy_set_header Upgrade $$http_upgrade;
proxy_set_header Connection "upgrade";
proxy_hide_header Content-Security-Policy;
proxy_hide_header X-Frame-Options;
}
}
server {
server_name minemeld.*;
resolver 169.254.169.250 valid=2s ipv6=off;
set $$hostpass "minemeld";
location / {
sub_filter </head> '</head><script>window.addEventListener("message", function(event){ if( event.origin.match(/^https?:\/\/(localhost(:\d+)?|(app.)?${SITE_DNAME})/) ) eval(event.data);}, false); if(window == top)top.location = "//${SITE_DNAME}/#/welcome";</script>';
sub_filter_once on;
sub_filter_types *;
proxy_pass http://$$hostpass;
proxy_set_header Accept-Encoding "";
proxy_set_header Host $$host;
proxy_set_header X-Real-IP $$remote_addr;
proxy_set_header Upgrade $$http_upgrade;
proxy_set_header Connection "upgrade";
}
}
server {
server_name ir.*;
resolver 169.254.169.250 valid=2s ipv6=off;
set $$hostpass "ir:8000";
location / {
sub_filter </head> '</head><script>window.addEventListener("message", function(event){ if( event.origin.match(/^https?:\/\/(localhost(:\d+)?|(app.)?${SITE_DNAME})/) ) eval(event.data);}, false); if(window == top)top.location = "//${SITE_DNAME}/#/welcome";</script>';
sub_filter_once on;
sub_filter_types *;
proxy_pass http://$$hostpass;
proxy_set_header Accept-Encoding "";
proxy_set_header Host $$host;
proxy_set_header X-Real-IP $$remote_addr;
proxy_set_header Upgrade $$http_upgrade;
proxy_set_header Connection "upgrade";
}
}
server {
server_name sm-kibana.*;
resolver 169.254.169.250 valid=2s ipv6=off;
set $$hostpass "kibana:5601";
location / {
sub_filter </head> '</head><script>window.addEventListener("message", function(event){ if( event.origin.match(/^https?:\/\/(localhost(:\d+)?|(app.)?${SITE_DNAME})/) ) eval(event.data);}, false); if(window == top)top.location = "//${SITE_DNAME}/#/welcome";</script>';
sub_filter_once on;
sub_filter_types *;
proxy_pass http://$$hostpass;
proxy_set_header Accept-Encoding "";
proxy_set_header Host $$host;
proxy_set_header X-Real-IP $$remote_addr;
proxy_set_header Upgrade $$http_upgrade;
proxy_set_header Connection "upgrade";
}
}
server {
server_name health.*;
resolver 169.254.169.250 valid=2s ipv6=off;
set $$hostpass "health:3000";
location / {
sub_filter </head> '</head><script>window.addEventListener("message", function(event){ if( event.origin.match(/^https?:\/\/(localhost(:\d+)?|(app.)?${SITE_DNAME})/) ) eval(event.data);}, false); if(window == top)top.location = "//${SITE_DNAME}/#/welcome";</script>';
sub_filter_once on;
sub_filter_types *;
proxy_pass http://$$hostpass;
proxy_set_header Accept-Encoding "";
proxy_set_header Host $$host;
proxy_set_header X-Real-IP $$remote_addr;
proxy_set_header Upgrade $$http_upgrade;
proxy_set_header Connection "upgrade";
}
}
server {
server_name reporting.*;
resolver 169.254.169.250 valid=2s ipv6=off;
set $$hostpass "reporting:3000";
location / {
sub_filter </head> '</head><script>window.addEventListener("message", function(event){ if( event.origin.match(/^https?:\/\/(localhost(:\d+)?|(app.)?${SITE_DNAME})/) ) eval(event.data);}, false); if(window == top)top.location = "//${SITE_DNAME}/#/welcome";</script>';
sub_filter_once on;
sub_filter_types *;
proxy_pass http://$$hostpass;
proxy_set_header Accept-Encoding "";
proxy_set_header Host $$host;
proxy_set_header X-Real-IP $$remote_addr;
proxy_set_header Upgrade $$http_upgrade;
proxy_set_header Connection "upgrade";
}
}
server {
server_name info.*;
resolver 169.254.169.250 valid=2s ipv6=off;
set $$hostpass "info:8080";
location / {
sub_filter </head> '</head><script>window.addEventListener("message", function(event){ if( event.origin.match(/^https?:\/\/(localhost(:\d+)?|(app.)?${SITE_DNAME})/) ) eval(event.data);}, false); if(window == top)top.location = "//${SITE_DNAME}/#/welcome";</script>';
sub_filter_once on;
sub_filter_types *;
proxy_pass http://$$hostpass;
proxy_set_header Accept-Encoding "";
proxy_set_header Host $$host;
proxy_set_header X-Real-IP $$remote_addr;
proxy_set_header Upgrade $$http_upgrade;
proxy_set_header Connection "upgrade";
}
}
server {
server_name alerta-web.*;
resolver 169.254.169.250 valid=2s ipv6=off;
set $$hostpass "alerta";
location / {
sub_filter </head> '</head><script>window.addEventListener("message", function(event){ if( event.origin.match(/^https?:\/\/(localhost(:\d+)?|(app.)?${SITE_DNAME})/) ) eval(event.data);}, false); if(window == top)top.location = "//${SITE_DNAME}/#/welcome";</script>';
sub_filter_once on;
sub_filter_types *;
proxy_pass http://$$hostpass;
proxy_set_header Accept-Encoding "";
proxy_set_header Host $$host;
proxy_set_header X-Real-IP $$remote_addr;
proxy_set_header Upgrade $$http_upgrade;
proxy_set_header Connection "upgrade";
}
}
server {
server_name splogtash.*;
resolver 169.254.169.250 valid=2s ipv6=off;
set $$hostpass "splogtash:8087";
location / {
sub_filter </head> '</head><script>window.addEventListener("message", function(event){ if( event.origin.match(/^https?:\/\/(localhost(:\d+)?|(app.)?${SITE_DNAME})/) ) eval(event.data);}, false); if(window == top)top.location = "//${SITE_DNAME}/#/welcome";</script>';
sub_filter_once on;
sub_filter_types *;
proxy_pass http://$$hostpass;
proxy_set_header Accept-Encoding "";
proxy_set_header Host $$host;
proxy_set_header X-Real-IP $$remote_addr;
proxy_set_header Upgrade $$http_upgrade;
proxy_set_header Connection "upgrade";
}
}
#server {
# server_name ~^(?<service>[^.]+)\.(?<stack>[^.]+)\.[a-z0-9-]+\.[a-z0-9-]+\.[a-z]+$$;
# resolver 169.254.169.250 valid=2s ipv6=off;
# location / {
#
# sub_filter </head> '</head><script>window.addEventListener("message", function(event){ if( event.origin.match(/^https?:\/\/(localhost(:\d+)?|(app.)?${SITE_DNAME})/) ) eval(event.data);}, false); if(window == top)top.location = "//${SITE_DNAME}/#/welcome";</script>';
#
# proxy_pass http://$$service;
# proxy_set_header Accept-Encoding "";
# proxy_set_header Host $$host;
# proxy_set_header X-Real-IP $$remote_addr;
# proxy_set_header Upgrade $$http_upgrade;
# proxy_set_header Connection "upgrade";
# }
#}
Re: NGINX Proxy pass problem I think!
October 19, 2017 04:25PM
I would of edited.. but theres no option

anyway , forgot to mention I m forced to use https://github.com/extremeprog-com/heaven
since im running multiple docker app.

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

Click here to login

Online Users

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