N
N
Nikita Chukov2016-10-29 00:50:23
Nginx
Nikita Chukov, 2016-10-29 00:50:23

How to set up proxying in Nginx?

Colleagues, a rather strange task, you need to consolidate several webmords from Mikrotik using Nginx, on one resource:

location / {
            root   /usr/share/nginx/html;
            index  index.html index.htm;
        }
        location  /pxe {
            alias /storage/pxe/distrs/ ;
            autoindex on;
        }

         location /mikrotik_zbc_1f/ {
                rewrite ^/mikrotik_zbc_1f/(.*) /$1 break;
                proxy_pass      http://gw.1f.zbc.company.com:8080/;
        }
         location /mikrotik_zbc_2f/ {
                rewrite ^/mikrotik_zbc_2f/(.*) /$1 break;
                proxy_pass      http://gw.2f.zbc.company.com:8080/;
        }

I always get 404

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2016-10-29
@ky0

Try to remove the rewrites and slashes in the lower locations, they are not needed if I understand your task correctly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question