Centos + Nginx+ httpd
Суть проблемы:
Первый вхост который на котором бэк работает на порту 8080, а фронт на 80
nginx vhost1server {
listen 80;
server_name ********;
#access_log /website/name.site/logs/nginx_access.log;
error_log /var/www/crmMSK/logs/nginx_error.log;
location / {
proxy_pass http://127.0.0.1:8080/;
proxy_read_timeout 300s;
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_buffering off;
}
location ~* \.(css|js|png|gif|jpg|jpeg|ico)$ {
root /var/www/crmMSK;
expires 1d;
}
location ^~ /phpmyadmin/
{
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;
proxy_connect_timeout 120;
proxy_send_timeout 120;
proxy_read_timeout 180;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
httpd1<VirtualHost *:8080>
ServerName *********
DocumentRoot /var/www/crmMSK
<Directory /var/www/crmMSK>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/www/crmMSK/logs/error.log
CustomLog /var/www/crmMSK/logs/access.log common
</VirtualHost>
Второй вхост, бэк на 8081 порт, фронт 7777 порт
nginx vhost2server {
listen 7777;
server_name ********;
#access_log /website/name.site/logs/nginx_access.log;
error_log /var/www/crmMSK/logs/nginx_error.log;
location / {
proxy_pass http://127.0.0.1:8081/;
proxy_read_timeout 300s;
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_buffering off;
}
location ~* \.(css|js|png|gif|jpg|jpeg|ico)$ {
root /var/www/crmMSK;
expires 1d;
}
location ^~ /phpmyadmin/
{
proxy_pass http://127.0.0.1:8081;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_connect_timeout 120;
proxy_send_timeout 120;
proxy_read_timeout 180;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
httpd2<VirtualHost *:8081>
ServerName *******
DocumentRoot /var/www/crmBLR
<Directory /var/www/crmBLR>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/www/crmBLR/logs/error.log
CustomLog /var/www/crmBLR/logs/access.log common
</VirtualHost>
так вот, первый вхост работает как нужно, а вот второй переадресует на 80 вместо 7777