Skip to main content

Adding custom configuration for / in NGINX

Comments

6 comments

  • cPRex Jurassic Moderator
    Hey there! I did some homework on this and I wasn't able to get this to work either. I spoke with one of the developers on the webserver team and it seems you aren't able to override /. It might be best to do this in a different way, such as a 302 redirect to /status or something similar, as anything I tried on my end resulted in a similar error with the Nginx / warning.
    0
  • gvard
    Hi Rex, Thank you for your help. Any ideas on how to make this work with a 302 redirect? Freshstatus allows only the use of a subdomain, not a directory of a subdomain.
    0
  • cPRex Jurassic Moderator
    I spoke with our developers about this and they found that this worked well: rewrite ^/$ http://www.domain.com/status redirect; location /status { proxy_set_header HOST $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass https://domaintld.freshstatus.io; }
    although this is specifically for /status and not / itself. Could you try that and see if that works for your situation?
    0
  • gvard
    Hi Rex, That rewrite rule in the beginning did the trick, thank you!
    0
  • cPRex Jurassic Moderator
    I'm glad that helped!
    0
  • MarceloSoares
    Hi Rex, That rewrite rule in the beginning did the trick, thank you!

    Hey, gvard. I tried to do like you, but got no results. Could you show me how you did it?
    0

Please sign in to leave a comment.