Onex ecstore多级部署之配置nginx

/ 0评 / 3

nginx相关配置如下:

        upstream myweb {
              server 10.172.191.207:8080 ;#web1
               server 10.172.193.245:8080 ;#web2
              # server 10.162.196.232:8080 ;#web3
              # server 10.172.194.60:8080 ;#web4
        }
        upstream shopadmin{
                server 10.172.191.207:8080;
        }



         server
        {
                listen 80;
                server_name www.etop1.cn;
                location ~ ^/shopadmin(.*) {
                    proxy_set_header Host $host;
                    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header REMOTE-HOST $remote_addr;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                    proxy_pass http://shopadmin;
                }

                location ~ ^/(index.php/|)shopadmin(.*) {
                    proxy_set_header Host $host;
                    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header REMOTE-HOST $remote_addr;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                    proxy_pass http://shopadmin;
                }
                location ~ ^/(index.php/|)data(.*) {
                    proxy_set_header Host $host;
                    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header REMOTE-HOST $remote_addr;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                    proxy_pass http://shopadmin;
                }
                location ~ ^/(index.php/|)public(.*) {
                    proxy_set_header Host $host;
                    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header REMOTE-HOST $remote_addr;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                    proxy_pass http://shopadmin;
                }
                location ~ ^/(index.php/|)themes(.*) {
                    proxy_set_header Host $host;
                    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header REMOTE-HOST $remote_addr;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                    proxy_pass http://shopadmin;
                }
                location ~ ^/(index.php/|)phpmyadmin(.*) {
                    proxy_set_header Host $host;
                    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header REMOTE-HOST $remote_addr;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                    proxy_pass http://shopadmin;
                }

                location / {
                        proxy_set_header Host $host;
                        proxy_set_header X-Real-IP $remote_addr;
                        proxy_set_header REMOTE-HOST $remote_addr;
                        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                        proxy_pass http://myweb;
                }
    #            access_log /tmp/web.log;
        }

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注