1.创建vhost文件夹,路径为/usr/local/nginx/conf/vhost 2.编辑nginx.conf,路径为 /usr/local/nginx/conf/nginx.conf #修改一,引入虚拟主机的配置文件 #修改二,注释掉server段 #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log...
1cat/etc/hosts2##3# Host Database4#5# localhost is used to configure the loopback interface6# when the system is booting. Do not change this entry.7##8127.0.0.1localhost9255.255.255.255broadcasthost10::1localhost11fe80::1%lo0 localhost12127.0.0.1ysy1.com13127.0.0.1ysy2.com14127.0.0.1www.ys...
# another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / { # root html; # index index.html index.htm; # } #} # HTTPS server # #server { # listen ...
# another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / { # root html; # index index.html index.htm; # } #} # HTTPS server # #server { # listen ...
#location~/\.ht{# deny all;#}}# another virtual host using mixofIP-,name-,and port-based configuration # #server{# listen8000;# listen somename:8080;# server_name somename alias another.alias;# location/{# root html;# index index.html index.htm;#}#}#HTTPSserver ...
#location~/\.ht{# deny all;#}}# Virtual Host configurationforexample.com # # You can move that to a different file under sites-available/and symlink that # to sites-enabled/to enable it.# #server{# listen80;# listen[::]:80;# ...
The final Apache virtual host configuration will include all httpd.conf and nginx.conf files from all virtual hosts. Where to Find Virtual Host Configuration Files Plesk always remembers how it was set up before. Because we record all previous configuration states in a virtual host configuration fi...
# another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / { # root html; # index index.html index.htm; ...
Virtual Host configuration for example.com You can move that to a different file under sites-available/ and symlink that to sites-enabled/ to enable it. #server { listen 80; listen [::]:80; server_name example.com; root /var/www/example.com; ...
3. Create Nginx Virtual Host (Server Blocks) To create an Nginx virtual host file inside thesites-availabledirectory, execute the following command: sudo vim /etc/nginx/sites-available/website1.com It is worth noting that the Nginx virtual host configuration file can be named whatever you like...