Nginx配置二级域名
- 首先, 需要在域名服务商处配置二级域名, 如阿里万网
- 配置nginx
我买的是digitalocean的服务器
server { listen 80; server_name domain.cc www.domain.cc; error_log /usr/local/log/nginx/error.log; location / { root /root/www/domain; index index.html index.php; } } server { listen 80; server_name blog.domain.cc; error_log /usr/local/log/nginx/blog-error.log; location / { root /root/www/blog; index index.html index.php; } }