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

Problems caused by nginx optimal configuration priority #6125

Open
NStart opened this issue Dec 2, 2024 · 2 comments
Open

Problems caused by nginx optimal configuration priority #6125

NStart opened this issue Dec 2, 2024 · 2 comments

Comments

@NStart
Copy link

NStart commented Dec 2, 2024

location /.well-known/acme-challenge/ {
default_type "text/plain; charset=utf-8";
root /www/wwwroot/java_node_ssl;
try_files $uri =404;
}
Use webroot to manually configure the above configuration, which can be successful.

But when you use --nginx, you will find that one challege fails, and the route of that challege never takes effect, reporting 404. The result of the investigation is that my site uses the Pagoda reverse proxy, and nginx has a higher priority configuration. What causes constant access is the proxy.

error config:
location ^~ / {

  proxy_pass http://127.0.0.1:8081;
  proxy_set_header Host $http_host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Real-Port $remote_port;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header REMOTE-HOST $remote_addr;
  proxy_connect_timeout 60s;
proxy_send_timeout 600s;
proxy_read_timeout 600s;
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection $connection_upgrade;
  
  
  
  
  
}

#PROXY-CONF-END

modified config:
location / {

  proxy_pass http://127.0.0.1:8081;
  proxy_set_header Host $http_host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Real-Port $remote_port;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header REMOTE-HOST $remote_addr;
  proxy_connect_timeout 60s;
proxy_send_timeout 600s;
proxy_read_timeout 600s;
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection $connection_upgrade;
  
  
  
  
  
}

#PROXY-CONF-END

In this way, the priority of the challege route will be higher.

Copy link

github-actions bot commented Dec 2, 2024

Please upgrade to the latest code and try again first. Maybe it's already fixed. acme.sh --upgrade If it's still not working, please provide the log with --debug 2, otherwise, nobody can help you.

@NStart
Copy link
Author

NStart commented Dec 2, 2024

Already in latest

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

1 participant