Welcome! Log In Create A New Profile

Advanced

Wrong Proxying

Posted by XXander 
Wrong Proxying
December 20, 2012 04:54AM
Привет всем !

При проксировании двух серверов с одинаковым портом попадает не туда, пример кофигов:

server {
server_name jira.dspdev.local wwww.jira.dspdev.local;
listen 80;

access_log /var/log/nginx/jira.access.log;
error_log /var/log/nginx/jira.error.log;

location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-for $remote_addr;
port_in_redirect off;
proxy_redirect off;
proxy_connect_timeout 600;
}

location ~* \.(js|css|rdf|xml|ico|txt|gif|jpg|png|jpeg)$ {
proxy_pass http://127.0.0.1:8080;
}
}

server {
server_name nexus.dspdev.local wwww.nexus.dspdev.local;
listen 80;

access_log /var/log/nginx/nexus.access.log;
error_log /var/log/nginx/nexus.error.log;

location / {
proxy_pass http://-.-.-.-:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-for $remote_addr;
#port_in_redirect off;
#proxy_redirect http://nexus.dspdev.local:8080/ http://-.-.-.-:8080/nexus;
proxy_connect_timeout 600;
}

location ~* \.(js|css|rdf|xml|ico|txt|gif|jpg|png|jpeg)$ {
proxy_pass http://-.-.-.-:8080;
}

}

если зайти на http://nexus.dspdev.local/nexus то все нормально

когда захожу на http://nexus.dspdev.local/ попадаю на страницу nginx "Welcome to nginx on EPEL!" причем картинки не показываются, по разному пытался делать, не выходит

когда захожу http://nexus.dspdev.local:8080/ попадаю сервер jira, как изменить чтобы исправить эту проблему ??? , уже пробывал редиректить и т п, не выходит
~
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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