Answer the question
In order to leave comments, you need to log in
Why is the URL duplicated?
Problem : I get " https://example.com,example.com/some-uri/ " instead of " https://example.com/some-uri/ ".
There are no errors in error.log and nothing in access.log, because the request is not received. On localhost without, respectively, nginx everything works fine. So it looks like the problem is somewhere between Flask and Nginx.
The site correctly returns responses if the URL ends with a slash, for example:
server {
server_name example.com www.example.com;
root /path/to/app;
listen 443 ssl;
//...
location / {
include /etc/nginx/proxy_params;
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ~ \.(jpg|jpeg|png|gif|js|txt|pdf) {
root /path/to/static/;
}
}
server {
if ($host = www.example.com) {
return 301 https://$host$request_uri;
}
if ($host = example.com) {
return 301 https://$host$request_uri;
}
listen 80;
server_name example.com www.example.com;
return 404;
}
Answer the question
In order to leave comments, you need to log in
I think you are missing try_files here . Now the link with / works for you , because in fact there is such a folder. As an example:
...
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question