Using Django on the backend with Gunicorn, each time I submit a form and am supposed to be sent to example.com/pagetwo
I am sent to localhost/pagetwo
instead.
I'm new to Nginx so if someone could point out what the problem is I'd be most greatful :)
default.conf:
server {
listen 80;
server_name example.com;
location /static/ {
root /srv;
}
location / {
proxy_redirect off;
proxy_pass http://unix:/srv/sockets/website.sock;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
Here is a form from the index page:
<form id='formone' method='POST' action=''> {% csrf_token %}
{{ form.as_p }}
<br />
<button type="submit" class="btn btn-success btn-sm">Submit</button>
</form>