1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
##### nginx install ##### /etc/yum.repos.d/nginx.repo [nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/7/$basearch/ gpgcheck=0 enabled=1 sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm sudo yum install nginx sudo systemctl start nginx sudo systemctl enable nginx ##### nginx setting ##### sudo mkdir /etc/nginx/sites-available sudo mkdir /etc/nginx/sites-enabled sudo nano /etc/nginx/sites-enabled/ include /etc/nginx/sites-enabled/*.conf; server_names_hash_bucket_size 64; sudo cp /etc/nginx/conf.d/default.conf /etc/nginx/sites-available/dev.easywaru.com.conf sudo nano /etc/nginx/sites-available/dev.easywaru.com.conf server_name dev.easywaru.com www.dev.easywaru.com location root /var/www/dev.easywaru.com/html; index index.html index.html; try_files $uri $uri/ = 404; sudo ln -s /etc/nginx/sites-available/dev.easywaru.com.conf /etc/nginx/sites-enabled/dev.easywaru.com.conf |