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

FAQ
It is currently Fri Dec 01, 2023 1:38 am


This forum is dedicated to Apache, Nginx, Lighttpd, Squid and other HTTP transport protocol related software

Author Message
mandrei99
Post  Post subject: Nginx: How to list virtual hosts  |  Posted: Mon Feb 23, 2015 5:05 pm

Joined: Tue Aug 04, 2009 9:16 am
Posts: 250

Offline
 

Nginx: How to list virtual hosts

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.





Top
Display posts from previous:  Sort by  
E-mail friendPrint view

Topics related to - "Nginx: How to list virtual hosts"
 Topics   Author   Replies   Views   Last post 
There are no new unread posts for this topic. Apache: how to list virtual hosts that are currently configured on my Apache server ?

LaR3

0

4772

Sun Feb 07, 2010 10:04 am

LaR3 View the latest post

There are no new unread posts for this topic. NGINX: how to set the default virtual host

mandrei99

0

3985

Thu Dec 12, 2013 6:01 am

mandrei99 View the latest post

There are no new unread posts for this topic. NGINX: 413 Request Entity Too Large

admin

0

2032

Thu Sep 14, 2017 4:48 am

admin View the latest post

There are no new unread posts for this topic. Attachment(s) Nginx + apache (for PHP) with real IP addresses in logs

designeru

0

3091

Tue May 18, 2010 9:49 am

designeru View the latest post

There are no new unread posts for this topic. Nginx + php-fpm increase upload_max_filesize and other php values per vhost

mandrei99

0

8226

Mon Jan 02, 2012 9:04 am

mandrei99 View the latest post

There are no new unread posts for this topic. NGINX: How to redirect http to https website

mandrei99

0

3903

Mon Feb 09, 2015 3:27 pm

mandrei99 View the latest post

There are no new unread posts for this topic. Converting PhpBB-SEO Apache RewriteRule to Nginx rewrite

debuser

0

10583

Tue Feb 23, 2010 5:00 am

debuser View the latest post

There are no new unread posts for this topic. Apache to Nginx Server parameters translation with php function

debuser

0

105101

Thu Aug 26, 2010 7:47 am

debuser View the latest post

There are no new unread posts for this topic. Starting nginx: [emerg]: directive "rewrite" is not terminated by ";"

debuser

0

8398

Tue Feb 23, 2010 6:05 am

debuser View the latest post

 

Who is online
Users browsing this forum: No registered users and 0 guests
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
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