Ubuntu Nginx Virtual Host 設定教學

設定檔放在 /etc/nginx/sites-available/

ln 建立 link 到 /etc/nginx/sites-enabled/

DEMO

server {
        listen 80;
        root /var/www/html/vh1;
        index index.html index.htm;
        server_name vh1.toright.com;
        location / {
                try_files $uri $uri/ =404;
        }
}
重啟
sudo service nginx restart
出處:

發佈留言