Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

FAQ
It is currently Sun Oct 20, 2019 1:08 pm


Username:
Subject:
Message body:
Enter your message here, it may contain no more than 60000 characters. 

Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
Font size:
 
Font colour
Options:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Disable BBCode
Disable smilies
Do not automatically parse URLs
Confirmation code
Confirmation code:
In an effort to prevent automatic submissions, we require that you enter both of the words displayed into the text field underneath.
     

Topic review - Nginx: How to list virtual hosts
Author Message
Post subject: Nginx: How to list virtual hosts  |  Post Posted: Mon Feb 23, 2015 5:05 pm
Unlike Apache (see https://forum.ivorde.com/apache-how-to-list-virtual-hosts-that-are-currently-configured-on-my-apache-server-t53.html), nginx does not have, at the time of this writing, a builtin option to list configured virtual hosts, so in order to lists vhosts in Nginx web server, all nginx configuration files should be checked for the key "server_name" that are not commented (lines begin with #).

How to list virtual hosts configured in NGINX


Code:
root@ubuntu-vpsie:~# find /etc/nginx/ -type f -name "*.conf" -print0 | xargs -0 egrep '^(\s|\t)*server_name'
/etc/nginx/conf.d/server1.conf:        server_name server1.domain.com;
/etc/nginx/conf.d/server2.conf:        server_name server2.domain.com;


Where /etc/nginx is nginx configuration directory and "*.conf" are all configuration files.
Jump to:  
News News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list


Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]



phpBB SEO