Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VIRTUAL_PATH Error #2003

Open
linrong opened this issue Jun 21, 2022 · 2 comments
Open

VIRTUAL_PATH Error #2003

linrong opened this issue Jun 21, 2022 · 2 comments

Comments

@linrong
Copy link

linrong commented Jun 21, 2022

hi, i use nginx-proxy and acme-companion with version like:

nginxproxy/acme-companion   2.2.1
nginxproxy/nginx-proxy      1.0.1 

I want to use VIRTUAL_PATH for forwarding my request
The configuration in docker-compose is as follows:

 cloud-web:
    environment:
      VIRTUAL_PROTO: uwsgi
      VIRTUAL_HOST: xxxxx.cn
      VIRTUAL_PORT: 8000
      VIRTUAL_PATH: /api
      LETSENCRYPT_HOST: xxxxx.cn
      LETSENCRYPT_EMAIL: test@gmail.cn
    image: django:1.8

And I add a configuration file to the vhost directory:

# xxxxx.cn
location / {
    try_files $uri $uri/ @router;
    index index.html index.htm;
}

location @router {
     rewrite ^.*$ /index.html last;
}

I'm going to use nginx config file to handle location / and use docker-compose to automatically generate location /api
But nginx-proxy runs wrong
I see the default.conf,I found that this repeatedly generates a location /

server {
        server_name xxxxx.cn;
        listen 80 ;
        access_log /var/log/nginx/access.log vhost;
        include /etc/nginx/vhost.d/xxxxx.cn;
location /api {
                include uwsgi_params;
                uwsgi_pass uwsgi://xxxxx.cn-ada91241341ae792ecf0a59cad28616a77bab856;
                include /etc/nginx/vhost.d/xxxxx_location;
}
                        location / {
                                return 404;
                        }
}

This location / is repeated. I checked the documentation and issue and I can't seem to find a solution. How should I configure it?

@buchdag
Copy link
Member

buchdag commented Dec 27, 2022

@linrong unfortunately bypassing the / location with a custom config is currently not supported, wether you're using VIRTUAL_PATH or not.

@jhthorsen
Copy link

I was expecting vhost.d/app.example.com_location (without any hash) to be placed inside the location / if present, and then return 404 if not.

Would that be possible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants