Skip to main content

How to make permanent custom proxy_pass to location / in NGINX

Comments

5 comments

  • cPRex Jurassic Moderator

    Hey there!  You'll want to use an include file for that user as outlined here:

    https://support.cpanel.net/hc/en-us/articles/360052143374-How-to-customize-a-site-s-NGINX-Server-Block

    Can you try that and let me know if that works for you?

    0
  • Vladimir Kasagic

    Hello cPRex,

    Please explain how can I include location / {} server block in my include file, since I can't use it twice as this directive has been used in the default user config?

    This is the error that I'm getting:
    nginx: [emerg] duplicate location "/" in /etc/nginx/conf.d/users/yumidi/include.conf:1

    0
  • cPRex Jurassic Moderator

    You shouldn't need to add the global lines to that file as well - the includes are read in addition to the main configuration, not instead of.

    0
  • Vladimir Kasagic

    Sure I am aware of that, but I need to change proxy_pass directive for the global location. Is it possible to do it in any way? 

    0
  • cPRex Jurassic Moderator

    I did some testing with another technician and it doesn't look like a permanent modification to this area is possible within the current software.  I have two recommendations for your situation that might help:

    -configure a cron that runs after the nightly cPanel update to put your changes back in place after the file is overwritten
    -submit a feature request at features.cpanel.net to see if this is a function we'd consider adding.

    I'm sorry I don't have better news on this one but let me know if you need anything else.

    0

Please sign in to leave a comment.