Skip to main content

Nginx conf file resets to defualt everyday

Comments

14 comments

  • cPRex Jurassic Moderator
    Hey there! This is normal behavior as you aren't able to directly edit the configuration files on a cPanel system. You'll want to check the "Custom Configurations" section in our documentation here:
    0
  • Abraham93
    I have done what it says on "User Configuration" created a /etc/nginx/conf.d/users/username/domainname/domain.conf added my nginx configuration and then I got this error: nginx: [emerg] "server" directive is not allowed here in /etc/nginx/conf.d/users/username/domainname/domain.conf:1 Then I tried on /etc/nginx/conf.d/server-includes/domain.conf and got same error. (I have 2 domains in my vps) Then I realized that somehow one of my domains, domainA.conf its empty but domainB.conf (the one I'm using and editting everyday after it resets) has a nginx default config, even I deleted and made my "User Configuration" and updated the server it automatically creates again domainB.conf with nginx default config. How can I stop this just like my domainA.conf that keeps empty. After all this I realized again that my domainB.conf has a "include" so on my "User Confugration" I just kept what I need but then since my domainB.conf has a "location / { ... }" I cannot rewrite and show a duplicate error.
    0
  • cPRex Jurassic Moderator
    It might be best to create a ticket for this issue so we can see the specific file, configurations, and the duplicate error. Could you create that ticket and then post the number here so I can follow along?
    0
  • Abraham93
    Thanks this is the ticket #94495954
    0
  • cPRex Jurassic Moderator
    Thanks for that - I'm following along on my end now.
    0
  • cPRex Jurassic Moderator
    I see we recommended placing the customizations in /etc/nginx/conf.d/users/username/domain.com/custom.conf - let us know once you've had a chance to test that!
    0
  • caos989
    I want to use Nginx + Varnish Cache for Magento 2.4 I have the same problem like abraham93. My mainproblem is that Varnish needs port 80 for working. Is there a solution to deactivate the overwriting of listen ports in /etc/nginx/conf.d/users/user.conf ?
    0
  • cPRex Jurassic Moderator
    @caos989 - there is not a supported way to make that change. Our implementation of Nginx is designed for frontend caching to the Apache service, so it will always attempt to use the next highest port number, which is typically 81 and 444.
    0
  • caos989
    @caos989 - there is not a supported way to make that change. Our implementation of Nginx is designed for frontend caching to the Apache service, so it will always attempt to use the next highest port number, which is typically 81 and 444.

    81 and 444 for NGINX would be fine. 8080 and 443 even better. My Apache is running on 8181 and 444 now. Right now my nginx is getting resettet to Port 80 and 443 everytime so It's blocking Varnish from starting. Can you tell me where is the file that tell my user.conf file to change the Port to 80?
    0
  • cPRex Jurassic Moderator
    There isn't a way to change that behavior at this time. If you'd like to submit a feature request to have us add this customization I can bring it up with the team during our next features meeting.
    0
  • caos989
    I made a request :) I hope you can change this because I think there are a lot of Magento users who can benefit from this.
    0
  • cPRex Jurassic Moderator
    I did get that approved. I haven't done the features for this week yet, so I'll get that added to this week's meeting!
    0
  • caos989
    are there any updates done?
    0
  • cPRex Jurassic Moderator
    At this time, it isn't something we plan to implement.
    0

Please sign in to leave a comment.