😀nginx安装

安装方法可以在网上找,下面给出的是配置.

set_real_ip_from 127.0.0.1;
#set_real_ip_from unix:;
real_ip_header proxy_protocol;

server {
    listen 127.0.0.1:5001 proxy_protocol default_server;
    listen 127.0.0.1:5002 proxy_protocol default_server http2;
    location / {
        root /root/html;
        index  index.html index.htm;
        proxy_max_temp_file_size 0;
    }
}

server {
    listen unix:/dev/shm/default.sock proxy_protocol;
    listen unix:/dev/shm/h2c.sock http2 proxy_protocol;
    #listen 127.0.0.1:5003 proxy_protocol default_server;
    #listen 127.0.0.1:5004 proxy_protocol default_server http2;
    #listen 5003 default_server;
    #listen 5004 ssl default_server http2;
    #set_real_ip_from 127.0.0.1;
    #real_ip_header proxy_protocol;   
    server_name us04.didadi.top;
    #ssl on;
    ssl_certificate /root/cert/xxxxxx.top.cer;
    ssl_certificate_key /root/cert/xxxxxx.top.key;
   
    ssl_session_timeout 5m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;

    location / {
        root /root/html;
        index  index.html index.htm;
        proxy_max_temp_file_size 0;
    }
}

server {
    listen 80;
    return 301 https://$host$request_uri;
}

Last updated