Answer the question
In order to leave comments, you need to log in
How to add admin settings to this config?
Now the application itself is running on the server using xxx.xxx.xxx.xxx ip on local port 5000, you need to make sure that the admin panel works on the same ip. I would like to make an appeal to it like xxx.xxx.xxx.xxx/admin. I found a close answer in another question, but I can’t apply it to my task, I’m confused because of the @fallback block. Here is the code of the person who gave the approximate answer:
server {
listen 80;
server_name site.ru;
location /admin {
proxy_pass http://localhost:50001;
}
location / {
proxy_pass http://localhost:50000;
}
}
server {
server_name 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/site.org/*.conf;
access_log /var/www/httpd-logs/site.org.access.log;
error_log /var/www/httpd-logs/site.org.error.log notice;
ssi on;
set $root_path /var/www/www-root/data/www/site.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;
}
Answer the question
In order to leave comments, you need to log in
Subject to explanation, you can simply insert location:
location /admin {
proxy_pass http://localhost:50001;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question