SimpleDao
nginx配置https证书
2019-05-06, 访问数: 860
  1. #upstream mysvr {
  2. # server 127.0.0.1:8099 weight=1;
  3. # server 127.0.0.1:8099 weight=1;
  4. #}
  5. server {
  6. server_name example.com;
  7. listen 443 ssl;
  8. ssl_certificate /home/stat/example.com/cert/example.com.crt;
  9. ssl_certificate_key /home/stat/example.com/cert/ca.example.com.key;
  10. ssl_session_cache shared:SSL:1m;
  11. ssl_session_timeout 5m;
  12. ssl_ciphers HIGH:!aNULL:!MD5;
  13. ssl_prefer_server_ciphers on;
  14. log_format example_log '[$time_local] $remote_addr "$request" '
  15. '$status $upstream_status $body_bytes_sent $request_time $upstream_response_time '
  16. '"$remote_user" "$http_user_agent" "$http_referer"';
  17. access_log /var/www/example/nginxlog/access.log example_log;
  18. error_log /var/www/example/nginxlog/error.log;
  19. gzip on;
  20. location ~ ^/static/ {
  21. root /var/www/example;
  22. }
  23. location / {
  24. proxy_set_header Host $host;
  25. proxy_set_header X-REAL-IP $remote_addr;
  26. proxy_set_header X-FORWARDED-FOR $proxy_add_x_forwarded_for;
  27. proxy_ignore_client_abort on;
  28. #proxy_pass http://mysvr;
  29. proxy_pass http://127.0.0.1:8099;
  30. }
  31. }