Answer the question
In order to leave comments, you need to log in
Why the application and the admin panel are not launched on the same ip with this config?
I don’t fully understand what server_name should be for the admin panel so that there are no conflicts of duplicates. And how to access it from the Internet using this IP. There is a guess that the application call should be according to the classics: http://xxx.xxx.xxx.xxx, and the admin panel should be called like this http://xxx.xxx.xxx.xxx:port.
Configs:
Application:
server {
server_name http://xxx.xxx.xxx.xxx/;
charset off;
index index.php index.html;
disable_symlinks if_not_owner from=$root_path;
include /etc/nginx/vhosts-includes/*.conf;
include /etc/nginx/vhosts-resources/new.app.org/*.conf;
access_log /var/www/httpd-logs/new.app.org.access.log;
error_log /var/www/httpd-logs/new.app.org.error.log notice;
ssi on;
set $root_path /var/www/www-root/data/www/new.app.org;
root $root_path;
location / {
location ~ [^/]\.ph(p\d*|tml)$ {
try_files /does_not_exists @fallback;
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
try_files $uri $uri/ @fallback;
}
location / {
try_files /does_not_exists @fallback;
}
}
location @fallback {
proxy_pass http://127.0.0.1:5000;
proxy_redirect http://127.0.0.1:5000 /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
access_log off;
}
listen xxx.xxx.xxx.xxx:80 default_server;
}
server {
server_name http://xxx.xxx.xxx.xxx:4382/;
charset off;
index index.php index.html;
disable_symlinks if_not_owner from=$root_path;
include /etc/nginx/vhosts-includes/*.conf;
include /etc/nginx/vhosts-resources/admin.panel/*.conf;
access_log /var/www/httpd-logs/admin.panel.access.log;
error_log /var/www/httpd-logs/admin.panel.error.log notice;
ssi on;
set $root_path /var/www/www-root/data/www/admin.panel;
root $root_path;
location / {
location ~ [^/]\.ph(p\d*|tml)$ {
try_files /does_not_exists @fallback;
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
try_files $uri $uri/ @fallback;
}
location / {
try_files /does_not_exists @fallback;
}
}
location @fallback {
proxy_pass http://127.0.0.1:4382;
proxy_redirect http://127.0.0.1:4382 /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
access_log off;
}
listen xxx.xxx.xxx.xxx:80;
}
Answer the question
In order to leave comments, you need to log in
nginx: [warn] server name "xxx.xxx.xxx.xxx" has suspicious symbols in /etc/nginx/vhosts/www-root/new.app.org.conf:2
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question