天天看點

linux nginx 443端口通路

  • 我是在阿裡雲上配置443端口 首先點選SSL證書這裡 再選擇已簽發證書下載下傳 就會讓你選擇下載下傳證書的類型 我這裡是nginx 就選擇nginx版本下載下傳 如果沒有就需要購買了
    linux nginx 443端口通路
  1. 下載下傳好後解壓完成是這樣的檔案
    linux nginx 443端口通路
  2. events {
            worker_connections  1024;
       }
    
       http {
            include       mime.types;
            default_type  application/octet-stream;
    
       log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                                    '$status $body_bytes_sent "$http_referer" '
                                  '"$http_user_agent" "$http_x_forwarded_for"';
    
       access_log  /usr/local/nginx/logs/access.log  main;
    
       sendfile        on;
       #tcp_nopush     on;
    
       #keepalive_timeout  0;
       keepalive_timeout  65;
    
       #gzip  on;
    
       include /usr/local/nginx/conf/conf.d/*.conf;                        #我這裡跳轉到了另一個檔案
        }           
    location ~ \.php$ {                                                                    #我這裡還有配置php
         root           /opt/www;                                                            #網站位置 
         fastcgi_pass   127.0.0.1:9000;
         fastcgi_index  index.php;
         fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
         include        fastcgi_params;
     }
     location / {
        root /opt/www;                                                                       #網站位置
        index index.php index.html index.htm;
        if (!-e  $request_filename) {
        rewrite ^(.*)$ /index.php$1 last;                            
    }           

繼續閱讀