Configure nginx
- Start by opening a command prompt on your desktop
- Log in to your cloud server account SSH [email protected] the following IP address is the IP address of the public network and enter the password to enter the system
- CD/Go to the root directory ls List the file contents
- Install nginxyum install -y nginx
- To do this, go to /etc/nginx and create a vhost file with your domain.conf file in it
Put in the code below where the asterisk represents the domain name you registered
#upstream goserver {
# server 127.0. 01.:9000;
#}
server {
listen 80;
server_name ****;
# return 301 https://$server_name$request_uri;
#}
#server{
# listen 443 ssl;
# server_name api.bdplus.cn;
root /home/www/ * * * * * * *; #ssl on; # ssl_certificate /data/sys/cert/1531404801208/1531404801208.pem; # ssl_certificate_key /data/sys/cert/1531404801208/1531404801208.key; # ssl_session_timeout 5m; # ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:! NULL:! aNULL:! MD5:! ADH:! RC4; Ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # ssl_prefer_server_ciphers on; # location / { # index index.php index.html index.htm; # } #location / { # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # proxy_set_header Host $http_host; # proxy_redirect off; # proxy_pass http://goserver; # } # location ^~/api/{ #rewrite ^/api/(.*)/$1 break; #proxy_pass http://api.bdplus.cn/api/; #} # location ^~/home/{ # rewrite ^/home/(.*)/$1 break; # proxy_pass https://home-api.pinduoduo.com/home/; #} location /{ try_files $uri /index.html; index index.html index.htm index.php; } location ~ /\. { return 403; } access_log /data/log/www/******; }Copy the code
- CD/root ls View file have home go into home not create home go into home go into home create WWW go into WWW create your domain name in enter create an index. HTML content in CD/go to root create data in create log This is where the log exists
include vhost/*.conf;
Mkdir Creating a folder vi Creating a file CD Go to CD.. Back up CD/Go to the root directory I Run esc shift+ : wq to save the configuration and exit qt