• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved nginx configuration, listen to 0.0.0.0

bsssrl

New Pleskian
I need to edit /etc/nginx/plesk.conf.d/server.conf, but this file is generated automatically and could be overwritten.

For example


Code:
    ...
    server {
        listen 1.1.1.1:80;
        listen 0.0.0.0:80;
    ...

What's the right way obtain this results?

Thanks in advance!
 
Why not let Plesk reconfigure the file? You can even do it from the Plesk GUI and do not need the command line for it as the Plesk GUI runs on their own web server and a different port. Use Tools & Settings > Web Server Configurations Trouble Shooter and reconfigure all.
 
Sorry Peter, I'm not understanding.

I could change /etc/nginx/plesk.conf.d/server.conf via ssh. But I shouldn't, indeed on top of this file is clearly stated:

Code:
#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.

How I can tell plesk to reconfigure nginx in order to listen to 0.0.0.0?

Maybe I should edit the virtual host template and provide some configuration files inside conf folder? Should I follow some convention for names inside conf folder I'm not able to find any documentation about that?

Thanks again!
 
I am sorry I got you wrong. Obviously you want to enter your own IP. Why do you want Nginx to listen to a different IP than what is selected in your Plesk server configuration as that IP of the server?
 
You could always put your own .conf file into /etc/nginx/plesk.conf.d/ip_default/ because the server.conf line after the four you quoted includes all the .conf files in there. As long as your file name doesn't collide with those Plesk puts there, Plesk will leave it alone.
But I also would like to know what you want to do there. Multi-home a domain on the same server?
 
Back
Top