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

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.
主站蜘蛛池模板: 铜山县| 新泰市| 米脂县| 固始县| 灌阳县| 阿合奇县| 松原市| 鹤壁市| 鹤壁市| 政和县| 巨野县| 沂南县| 上虞市| 仪征市| 方山县| 合水县| 冷水江市| 双桥区| 白朗县| 临沭县| 岚皋县| 凤台县| 青铜峡市| 大竹县| 上饶县| 巨鹿县| 益阳市| 晋中市| 双峰县| 陇川县| 迁西县| 江西省| 沙田区| 大关县| 托克逊县| 乐清市| 商城县| 济源市| 常德市| 石棉县| 凤凰县|