Answer the question
In order to leave comments, you need to log in
Why does nginx redirect to port 80 if listen 7777 is set?
Centos + Nginx + httpd
The essence of the problem:
The first input on which the back works on port 8080, and the front on 80
server {
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;
}
}
<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>
server {
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;
}
}
<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>
Answer the question
In order to leave comments, you need to log in
Check the back, and specifically its config, I don’t know what is there, but in this whole bunch, only the back can do this.
Although the front can, but there is less chance of fixing it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question