I have, what I hope is, a simple question. I am running Nginx and some applications in Docker containers. Some of the applications run on the same host as Nginx. I can access an application using, for example, app.example.com
, but I want to access the same application using example.com/app
. I cannot figure out how to define the server block with location /app
. I would like to achieve something like:
server {
listen 80;
server_name app.example.com;
location / {
proxy_pass app-srv:port;
}
}
server {
listen 80;
server_name example.com;
location /app {
What do I place here?
}
}
Edit: with additional information.
My server configuration is:
server {
listen 80;
server_name openhab.aronica-sys;
location / {
proxy_pass http://openhab:8081;
}
}
server {
listen 80;
server_name aronica-sys;
location /openhab/ {
proxy_pass http://openhab:8081/;
}
}
openhab
in the proxy_pass statements is the Docker virtual address for the openHAB server.
'openhab.aronica-sys' gets:
VM6:1 XHR finished loading: GET "http://openhab.aronica-sys/rest/ui/tiles".
VM6:1 XHR finished loading: GET "http://openhab.aronica-sys/rest/".
VM6:1 XHR finished loading: GET "http://openhab.aronica-sys/rest/habot/greet".
VM6:1 XHR finished loading: GET "http://openhab.aronica-sys/rest/ui/components/ui:widget".
VM6:1 XHR finished loading: GET "http://openhab.aronica-sys/rest/ui/components/ui:page".
VM6:1 XHR finished loading: GET "http://openhab.aronica-sys/rest/items?metadata=semantics,listWidget,widgetOrder".
VM6:1 XHR finished loading: POST "http://openhab.aronica-sys/rest/events/states/2e0eee99-770f-498b-bd9f-736777096c30".
VM6:1 XHR finished loading: POST "http://openhab.aronica-sys/rest/events/states/2e0eee99-770f-498b-bd9f-736777096c30".
aronica-sys/openhab
gets:
VM6:1 GET http://aronica-sys/rest/ui/tiles 404 (Not Found)
VM6:1 GET http://aronica-sys/rest/ 404 (Not Found)
VM6:1 XHR failed loading: GET "http://aronica-sys/rest/ui/tiles".
aronica-sys/:1 Uncaught (in promise) Not Found
aronica-sys/:1 Uncaught (in promise) Not Found
VM6:1 XHR failed loading: GET "http://aronica-sys/rest/".
I do not know how to interpret the above information nor how to proceed.