G
G
Gourii2020-11-25 10:26:49
Django
Gourii, 2020-11-25 10:26:49

How to remove "?" at the end of url?

I have a website (django + gunicorn + nginx) that I'm making for myself.

5fbe025766e52132381086.png
When opening any of the internal sites, a "?" sign is added to the end of the url.

5fbe03765652e925887499.png

How to remove it?
If I understand correctly, NGINX appends it. Tried to remove "?" adding to /etc/nginx/sites-available/default:

rewrite ^/(.*)/$ /$1 permanent;

Did not help.

default

server {
        listen 81 default_server;
        listen [::]:81 default_server;
        root /var/www/html;

        index index.html index.htm index.nginx-debian.html;

        location /static {
                alias /home/gourii/webapp/LocalSite/showls/static;
}

        server_name _;
        location / {
                proxy_pass http://127.0.0.1:8001;
                proxy_set_header X-Forwarded-Host $server_name;
                proxy_set_header X-Real-IP $remote_addr;
                add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"';
                add_header Access-Controll-Allow-Origin *;
        }
}

server {
        listen 82 default_server;
        listen [::]:82 default_server;
        root /var/www/html;

        index index.html index.htm index.nginx-debian.html;

        server_name _;
        location / {
                proxy_pass http://127.0.0.1:8002;
                proxy_set_header X-Forwarded-Host $server_name;
                proxy_set_header X-Real-IP $remote_addr;
                add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"';
                add_header Access-Controll-Allow-Origin *;
        }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tema_sun, 2020-11-25
@tema_sun

Your "?" appears because you're submitting the form with a get request, not just opening a link with an "a" tag. Replace the form template with links and there will be no question mark.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question