Ubuntu16.04 Nginx配置HTTPS
来源:互联网 发布:win10 php安装环境 编辑:程序博客网 时间:2024/06/02 02:16
apt-get install build-essential
apt-get install libtool
apt-get install libpcre3 libpcre3-dev
apt-get install zlib1g-dev
apt-get install openssl
apt-get install nginx
默认配置文件位置 /etc/nginx/nginx.conf
默认可执行程序位置 /usr/sbin/nginx
/usr/sbin/nginx #启动
/usr/sbin/nginx -t #检测配置文件是否正确
/usr/sbin/nginx -s stop #停止
/usr/sbin/nginx -s reload #重载配置文件
配置文件内容:
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
server {
listen 443;
server_name xx.xx.xx.xx;
ssl on;
ssl_certificate /mycert/server.crt; # 自己生成
ssl_certificate_key /mycert/server.key; #自己生成
ssl_session_timeout 5m;
# ssl_protocols SSLv2 SSLv3 TLSv1;
# ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
# ssl_prefer_server_ciphers on;
location / {
root html;
index testssl.html index.html index.htm;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://115.159.119.234;
}
}
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}
- Ubuntu16.04 Nginx配置HTTPS
- Ubuntu16.04 + Nginx 配置虚拟主机
- ubuntu16.04安装配置Nginx
- 从0开始搭建阿里云(腾讯云)ubuntu16.04 nodejs + nginx + mysql + pm2 服务(五、nginx https 配置)
- Ubuntu16.04配置Nginx支持FastCGI
- ubuntu16.04 tomcat nginx ssl 配置
- Nginx(12):nginx配置https
- nginx 配置https server
- nginx 配置https
- Nginx 配置 https 加密
- Nginx配置https服务器
- Ubuntu nginx 配置https
- nginx https配置
- nginx配置https
- nginx 配置https
- nginx 配置HTTPS服务器
- Linux nginx配置https
- nginx 配置https 环境
- 【给小俊的教程 1】Shell 基本命令 1
- parseRequest(RequestContext)还是parseRequest(HttpServletRequest)
- 基于iData平台的数字城市整理建库方法
- windows + Linux禅道环境搭建
- Android 相机拍照后 ,Intent 返回 null问题 的 l对应方法
- Ubuntu16.04 Nginx配置HTTPS
- 定义一个平面中的Circle类:
- JS总结-----JavaScript对象
- hive 变量替换
- java开发WEB应用需要的基础知识
- 可重入函数与不可重入函数
- android学习---使用OkHttp
- Python 命名规范
- ES6--数据结构Set