小编Shi*_*dla的帖子

nginx基于域名重定向

我有一个 django web 应用程序,它在服务器上运行,IP 地址xx.xxx.105.49和域为www.example1.com

下面是我的nginx配置

server {
  listen 80;
  server_name  example1.com  www.example1.com ;
 
  location / { 
    return 301    https://www.example1.com$request_uri;
  }
}

server {
    listen 443 ssl;
    server_name  example1.com  www.example1.com;

    ssl_certificate      /etc/ssl/company/company.com.chained.crt;
    ssl_certificate_key  /etc/ssl/company/www.company.com.key;
    ssl_session_timeout  20m;
    ssl_session_cache    shared:SSL:10m;  # ~ 40,000 sessions
    ssl_protocols        TLSv1 TLSv1.1 TLSv1.2; # SSLv2
#    ssl_ciphers          ALL:!aNull:!eNull:!SSLv2:!kEDH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+EXP:@STRENGTH;
    ssl_ciphers          HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers on;
    client_max_body_size 20M;

    location / {
        proxy_pass http://127.0.0.1:8001;
        proxy_connect_timeout 300s;
        proxy_read_timeout 300s;
    }

  location /static/ {
    alias /home/apps/webapp/company/new_media/;
  }

  location /media/ {
    alias …
Run Code Online (Sandbox Code Playgroud)

ssl nginx domain

5
推荐指数
1
解决办法
2万
查看次数

标签 统计

domain ×1

nginx ×1

ssl ×1