官术网_书友最值得收藏!

How to do it...

  1. To serve static files, we're going to edit the default site configuration file /etc/nginx/conf.d/default.conf and make a few small changes.

Edit the file and add the following:

      server {
listen 80;
server_name server.yourdomain.com;
access_log /var/log/nginx/log/host.access.log combined;

location / {
root /var/www/html;
index index.html;
}
}
  1. If the folder doesn't exist, create the /var/www/vhosts directory with the following command:
      mkdir -p /var/www/vhosts
  1. Copy your existing website files into the /var/www/vhosts directory.
  2. Ensure the files and folders have permission to be read by the nginx user:
      chmod -R o+r /var/www/vhosts
chown -R nginx:nginx /var/www/vhosts
  1. From your web browser, browse the site and check that it's working.
主站蜘蛛池模板: 酉阳| 岗巴县| 赣榆县| 万全县| 巴林右旗| 芦溪县| 邢台县| 类乌齐县| 社旗县| 汤原县| 白河县| 遂平县| 鄂托克前旗| 苍梧县| 如皋市| 崇信县| 乌拉特中旗| 会同县| 灵寿县| 樟树市| 丘北县| 彩票| 湖州市| 楚雄市| 织金县| 康乐县| 崇文区| 牙克石市| 滨州市| 古蔺县| 乳源| 汶川县| 奇台县| 巢湖市| 蓬莱市| 阳春市| 兴文县| 宁阳县| 桃源县| 兰考县| 台安县|