How to list all vhosts on CentOS 7? (nginx)

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I have configured different virtual hosts on my machine. I want to ask the command which displays the list of all virtual hosts.







share|improve this question






















  • apache2ctl -S
    – ivanivan
    Apr 3 at 15:26










  • we are using ngnix
    – flik
    Apr 3 at 15:50










  • Next time you may want to add that to the question :) But... apparently there is no equivalent for nginx - see serverfault.com/questions/333440/…
    – ivanivan
    Apr 3 at 15:58














up vote
0
down vote

favorite












I have configured different virtual hosts on my machine. I want to ask the command which displays the list of all virtual hosts.







share|improve this question






















  • apache2ctl -S
    – ivanivan
    Apr 3 at 15:26










  • we are using ngnix
    – flik
    Apr 3 at 15:50










  • Next time you may want to add that to the question :) But... apparently there is no equivalent for nginx - see serverfault.com/questions/333440/…
    – ivanivan
    Apr 3 at 15:58












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have configured different virtual hosts on my machine. I want to ask the command which displays the list of all virtual hosts.







share|improve this question














I have configured different virtual hosts on my machine. I want to ask the command which displays the list of all virtual hosts.









share|improve this question













share|improve this question




share|improve this question








edited Apr 3 at 23:29









Yurij Goncharuk

2,2582521




2,2582521










asked Apr 3 at 15:18









flik

1485




1485











  • apache2ctl -S
    – ivanivan
    Apr 3 at 15:26










  • we are using ngnix
    – flik
    Apr 3 at 15:50










  • Next time you may want to add that to the question :) But... apparently there is no equivalent for nginx - see serverfault.com/questions/333440/…
    – ivanivan
    Apr 3 at 15:58
















  • apache2ctl -S
    – ivanivan
    Apr 3 at 15:26










  • we are using ngnix
    – flik
    Apr 3 at 15:50










  • Next time you may want to add that to the question :) But... apparently there is no equivalent for nginx - see serverfault.com/questions/333440/…
    – ivanivan
    Apr 3 at 15:58















apache2ctl -S
– ivanivan
Apr 3 at 15:26




apache2ctl -S
– ivanivan
Apr 3 at 15:26












we are using ngnix
– flik
Apr 3 at 15:50




we are using ngnix
– flik
Apr 3 at 15:50












Next time you may want to add that to the question :) But... apparently there is no equivalent for nginx - see serverfault.com/questions/333440/…
– ivanivan
Apr 3 at 15:58




Next time you may want to add that to the question :) But... apparently there is no equivalent for nginx - see serverfault.com/questions/333440/…
– ivanivan
Apr 3 at 15:58










2 Answers
2






active

oldest

votes

















up vote
1
down vote



accepted










grep -RiI server_name /etc/nginx/conf.d/sites-enabled/ 


Use this command for CentOS7.






share|improve this answer






















  • Suggestion; form a habit of putting command options before all of the arguments.
    – Jeff Schaller
    Apr 4 at 11:32

















up vote
0
down vote













in https://stackoverflow.com/questions/32400933/how-can-i-list-all-vhosts-in-nginx its the answer:



grep server_name /etc/nginx/sites-enabled/* -RiI





share|improve this answer






















  • grep: /etc/nginx/sites-enabled/*: No such file or directory Above output is coming
    – flik
    Apr 4 at 8:00










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f435306%2fhow-to-list-all-vhosts-on-centos-7-nginx%23new-answer', 'question_page');

);

Post as a guest






























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote



accepted










grep -RiI server_name /etc/nginx/conf.d/sites-enabled/ 


Use this command for CentOS7.






share|improve this answer






















  • Suggestion; form a habit of putting command options before all of the arguments.
    – Jeff Schaller
    Apr 4 at 11:32














up vote
1
down vote



accepted










grep -RiI server_name /etc/nginx/conf.d/sites-enabled/ 


Use this command for CentOS7.






share|improve this answer






















  • Suggestion; form a habit of putting command options before all of the arguments.
    – Jeff Schaller
    Apr 4 at 11:32












up vote
1
down vote



accepted







up vote
1
down vote



accepted






grep -RiI server_name /etc/nginx/conf.d/sites-enabled/ 


Use this command for CentOS7.






share|improve this answer














grep -RiI server_name /etc/nginx/conf.d/sites-enabled/ 


Use this command for CentOS7.







share|improve this answer














share|improve this answer



share|improve this answer








edited Apr 4 at 11:47









Jeff Schaller

31.1k846105




31.1k846105










answered Apr 4 at 10:34









Naqash Malik

1262




1262











  • Suggestion; form a habit of putting command options before all of the arguments.
    – Jeff Schaller
    Apr 4 at 11:32
















  • Suggestion; form a habit of putting command options before all of the arguments.
    – Jeff Schaller
    Apr 4 at 11:32















Suggestion; form a habit of putting command options before all of the arguments.
– Jeff Schaller
Apr 4 at 11:32




Suggestion; form a habit of putting command options before all of the arguments.
– Jeff Schaller
Apr 4 at 11:32












up vote
0
down vote













in https://stackoverflow.com/questions/32400933/how-can-i-list-all-vhosts-in-nginx its the answer:



grep server_name /etc/nginx/sites-enabled/* -RiI





share|improve this answer






















  • grep: /etc/nginx/sites-enabled/*: No such file or directory Above output is coming
    – flik
    Apr 4 at 8:00














up vote
0
down vote













in https://stackoverflow.com/questions/32400933/how-can-i-list-all-vhosts-in-nginx its the answer:



grep server_name /etc/nginx/sites-enabled/* -RiI





share|improve this answer






















  • grep: /etc/nginx/sites-enabled/*: No such file or directory Above output is coming
    – flik
    Apr 4 at 8:00












up vote
0
down vote










up vote
0
down vote









in https://stackoverflow.com/questions/32400933/how-can-i-list-all-vhosts-in-nginx its the answer:



grep server_name /etc/nginx/sites-enabled/* -RiI





share|improve this answer














in https://stackoverflow.com/questions/32400933/how-can-i-list-all-vhosts-in-nginx its the answer:



grep server_name /etc/nginx/sites-enabled/* -RiI






share|improve this answer














share|improve this answer



share|improve this answer








edited Apr 4 at 11:35









Jeff Schaller

31.1k846105




31.1k846105










answered Apr 3 at 16:34









elfer

91




91











  • grep: /etc/nginx/sites-enabled/*: No such file or directory Above output is coming
    – flik
    Apr 4 at 8:00
















  • grep: /etc/nginx/sites-enabled/*: No such file or directory Above output is coming
    – flik
    Apr 4 at 8:00















grep: /etc/nginx/sites-enabled/*: No such file or directory Above output is coming
– flik
Apr 4 at 8:00




grep: /etc/nginx/sites-enabled/*: No such file or directory Above output is coming
– flik
Apr 4 at 8:00












 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f435306%2fhow-to-list-all-vhosts-on-centos-7-nginx%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

Peggy Mitchell

Palaiologos

The Forum (Inglewood, California)