I state I'm not an expert I'm learning; said this.....
i can't configure nginx on host to pass requests in tomcat container;
So I installed:
- tomcat in the container accessible (example ip) from internet 139.25.4.25:8080 and the example tomcat page is displayed
- nginx 139.25.4.25:80 and the sample nginx page is displayed
"tomcat and nginx are on the same machine with the only difference that tomcat is installed in the docker container"
Obviously nginx must not be the webserver but the proxy so I need to disable nginx as a web server and configure it as a proxy.
I tried to modify the default file in the path / etc / nginx / sites-available; the configuration I made it is this:
"" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "
server {
listen 80;
server_name 139.25.4.25.58;
location / private / link1 / {
proxy_pass http://127.0.0.1;
proxy_set_header Upgrade $ http_upgrade;
proxy_set_header Connection $ connection_upgrade;
proxy_set_header Host $ host;
proxy_set_header X-Real-IP $ remote_addr;
proxy_set_header Forwarded $ proxy_add_forwarded;
proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $ scheme;
proxy_set_header X-Forwarded-Host $ host;
proxy_set_header X-Forwarded-Port $ server_port;
}
"" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""
With this configuration nginx failed and does not restart while if I only configure the proxy_pass directive http://127.0.0.1 it does not give me an error in the test but it displays the nginx page when I type 139.25.4.25.58: 80 and instead I want it to be displayed the tomcat page pointing to 127.0.0.1:8080; on this last point I would have doubts that is, first of all when I type ip address or ifconfig on debian I am given the error that is I can not see the ip address in the docker container?
I hope for some help in some indication
Thank you