Netbox CSRF verification failed(403)

300 views
Skip to first unread message

Srija Gupta

unread,
Jul 16, 2020, 9:43:28 PM7/16/20
to NetBox
I have installed Netbox on apache2 over Http, whenever I am making a post request , I am getting a 403 error due to CSRF verification failure. I am using a custom port and  
my configuration.py has ALLOWED_HOSTS = ['*']

My netbox.conf file is:


<VirtualHost *:8086>

    ProxyPreserveHost On


    # CHANGE THIS TO YOUR SERVER'S NAME

    ServerName x.x.x.x:p #ip:port


    SSLEngine on

    SSLCertificateFile /etc/ssl/certs/netbox.crt

    SSLCertificateKeyFile /etc/ssl/private/netbox.key


    Alias /static /opt/netbox/netbox/static


    <Directory /opt/netbox/netbox/static>

        Options Indexes FollowSymLinks MultiViews

        AllowOverride None

        Require all granted

    </Directory>


    <Location /static>

        ProxyPass !

    </Location>


    RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}

    ProxyPass / http://127.0.0.1:8087/

    ProxyPassReverse / http://127.0.0.1:8087/


The Apache server is listening on port 8086, Gunicorn is listening on port 8087. All my GET requests work fine. Can you please help me troubleshoot

Vivek Janjrukiya

unread,
Jul 5, 2021, 5:46:46 PM7/5/21
to NetBox
Were you able to figure out this?, I am having the same issue
Reply all
Reply to author
Forward
0 new messages