Nginx reverse proxy server deployment

Reverse Proxy Summary:

1, set up nginx reverse proxy

2, each set of the proxy server 81,9000 in /usr/local/docker/nginx/conf/nginx.conf

3, 2 access address, access to their own set of static resources index.tml

3, the configuration of the docker-compose.yml nginx provided even a port number, the host left, to the right of the server,

4, port access to the domain:

         The domain modify  C: \ Windows \ System32 \ drivers \ etc under the hosts file,

        192.168.88.131 itoken.funtl.co m in front of the server address, domain name back I want to change address

 

Use nginx reverse proxy tomcat preliminary test:

Talk about focus:

1, first create tomcat two containers, Nginx reverse proxy This section has

2, nginx.conf set the proxy. tomcat Access Port

3, to achieve access http://itoken.funtl.com:81/    Jump to page tomcat, ( 192.168.88.131:9090 )

4, nginx proxy tomcat complete

 

Use nginx reverse proxy tomcat final version:

1, see the last chart, replacing nginx.conf specific details View: Nginx Load Balancing

2, the old version can be done, refresh switching service, the new version to cancel this function only when the service is stopped, the other service will not start (replacement)

 

Knowledge summary:

    Premise: deploy their own container (linux), java is service

    proxy_pass setup requires proxy services (container) Ok! ! !

    6 downstairs to eat

 

 

version: '3.1'

services:

nginx:

restart: always

image: nginx

container_name: nginx

ports:

- 81:80

- 9000:9000

volumes:

- ./conf/nginx.conf:/etc/nginx/nginx.conf

- ./wwwroot:/usr/share/nginx/wwwroot

 

 

 

Guess you like

Origin blog.csdn.net/qq_40585396/article/details/93378000