In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "introduction of Nginx multi-domain name configuration". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "Nginx multi-domain name configuration method introduction" bar!
In many cases, you need to use multiple domain names, but you only have one server, so how to set up a server so that one server can access the corresponding domain name? the following method is to build a Nginx on the server and modify its configuration directly, as follows:
User www www; # user name: worker_processes 2: errorists log. / error.log;#error_log logs/error.log notice;pid / usr/local/nginx/nginx.pid;worker_rlimit_nofile 65535: events {use epoll; worker_connections 65535;} http {include mime.types; default_type application/octet-stream Log_format main'$remote_addr-$remote_user [$time_local] "$request"'$status $body_bytes_sent "$http_referer"'"$http_user_agent"$http_x_forwarded_for"; # access_log logs/access.log main; server_names_hash_bucket_size 128; client_header_buffer_size 32k; large_client_header_buffers 4 32k; client_max_body_size 8m; sendfile on; tcp_nopush on Keepalive_timeout 60; tcp_nodelay on; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; fastcgi_buffer_size 64k; fastcgi_buffers 4 64k; fastcgi_busy_buffers_size 128k; fastcgi_temp_file_write_size 128k; gzip on; gzip_min_length 1k; gzip_buffers 4 16k; gzip_http_version 1.0; gzip_comp_level 2; gzip_types text/plain application/x-javascript text/css application/xml; gzip_vary on # the first domain name service server {listen 80th # listening port server_name website1.com;# server URL root / usr/local/nginx/html;# site directory index test.html test.htm test.php;# URL file} # the second domain name service server {listen 80; server_name website1.com; location / {# location can not be written or written But if you need to do more detailed configuration, you need to use the location root / usr/local/nginx/html1;# site directory, you can define index x264.html;} # prohibit access to server {listen 80 default_server; server_name _; return 403;} # allow the domain name corresponding to the IP address to access server {listen 80 default; server_name _; return 500;}}
If you have any questions about the above Nginx building and configuration process, you can check out another article: https://www.jb51.net/article/122603.htm
Note: the domain name here must be exactly the same as the domain name you registered, otherwise the configuration fails, the contents of the default index.html will be called, or the Nginx will not be started directly.
At this point, I believe you have a deeper understanding of the "introduction to Nginx multi-domain name configuration". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.