Nginx deployment_mysql proxy_redis proxy_phoenix proxy_xxljob proxy_websocket proxy_Nacos proxy_intranet penetration proxy_multi-system forwarding---record 021_big data work notes 0181

  Accumulated deployment experience in building a big data platform:

When deploying the Spring Cloud Alibaba application, the application is probably deployed to the intranet, but in some environments with strict network security requirements, at this time, the service cannot be directly exposed, including database access, etc. need to be proxied

How to write the nginx configuration file of this proxy?

1. After a long time of sharing, first of all, how to proxy and connect to mysql remotely:

2. Nginx remote proxy redis connection, remote proxy phoenix connection

3. Nginx remote proxy websocket

4. Nginx front-end configuration, the style cannot be displayed

         try_files $uri $uri/ /index.html; This is the effect of this sentence If you find a problem with the style,

5. Pay attention here, if it is websocket configuration: how here

You can see that I wrote myWS, so pay attention here:

Just follow the configuration below: /myWS is fine, there is no / behind it

Then when creating a websocket server in springboot, there is also no /

 


#user  nobody;
worker_processes  4;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    use epoll;
    worker_connections  65535;
}

stream {

    upstream mysql {
       hash $remote_addr consistent;
       server 172.18.112.110:3

Guess you like

Origin blog.csdn.net/lidew521/article/details/131896978