Ubuntu安装openresty
目录
直接执行
|
|
pem的目录: /usr/local/openresty/nginx/conf/pem
server {
listen 80;
server_name www.mmfei.com
error_page 500 502 503 504 /50x.html;
error_log /data/nginx/www.mmfei.com/error.log;
access_log /data/nginx/www.mmfei.com/access_$logdate.log;
index index.html index.htm index.php;
location = / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Access-Control-Expose-Headers Content-Disposition;
proxy_http_version 1.1;
proxy_set_header Connection keep-alive;
proxy_pass http://127.0.0.1:9601;
}
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Access-Control-Expose-Headers Content-Disposition;
proxy_http_version 1.1;
proxy_set_header Connection keep-alive;
if (!-e $request_filename) {
proxy_pass http://127.0.0.1:9601;
}
}
location = /50x.html {
root /usr/share/nginx/html;
}
}
server {
listen 443 ssl;
server_name www.mmfei.com
error_page 500 502 503 504 /50x.html;
index index.html index.htm;
access_log /data/nginx/www.mmfei.com/access_$logdate.log;
error_log /data/nginx/www.mmfei.com/error.log;
ssl_session_cache shared:SSL:1m;
ssl_certificate pem/www.mmfei.com/cert.pem; # pem文件的路径
ssl_certificate_key pem/www.mmfei.com/key.pem; # 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 = / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Access-Control-Expose-Headers Content-Disposition;
proxy_http_version 1.1;
proxy_set_header Connection keep-alive;
proxy_pass http://127.0.0.1:9601;
}
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Access-Control-Expose-Headers Content-Disposition;
proxy_http_version 1.1;
proxy_set_header Connection keep-alive;
if (!-e $request_filename) {
proxy_pass http://127.0.0.1:9601;
}
}
location = /50x.html {
root /usr/share/nginx/html;
}
}