Guest User

Untitled

a guest
Feb 20th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. user eneas;
  2. worker_processes auto;
  3. pid /run/nginx.pid;
  4. include /etc/nginx/modules-enabled/*.conf;
  5.  
  6. events {
  7. worker_connections 768;
  8. # multi_accept on;
  9. }
  10.  
  11. http {
  12.  
  13. ##
  14. # Basic Settings
  15. ##
  16.  
  17. sendfile on;
  18. tcp_nopush on;
  19. tcp_nodelay on;
  20. keepalive_timeout 65;
  21. types_hash_max_size 2048;
  22. # server_tokens off;
  23.  
  24. # server_names_hash_bucket_size 64;
  25. # server_name_in_redirect off;
  26.  
  27. include /etc/nginx/mime.types;
  28. default_type application/octet-stream;
  29.  
  30. ##
  31. # SSL Settings
  32. ##
  33.  
  34. ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
  35. ssl_prefer_server_ciphers on;
  36.  
  37. ##
  38. # Logging Settings
  39. ##
  40.  
  41. access_log /var/log/nginx/access.log;
  42. error_log /var/log/nginx/error.log;
  43.  
  44. ##
  45. # Gzip Settings
  46. ##
  47.  
  48. gzip on;
  49. gzip_disable "msie6";
  50.  
  51.  
  52. include /etc/nginx/conf.d/*.conf;
  53. include /etc/nginx/sites-enabled/*;
  54. }
  55.  
  56. server {
  57. listen 80;
  58. listen 443 ssl;
  59. server_name eneas;
  60.  
  61. ssl_certificate /etc/nginx/ssl/.../ssl-bundle.crt;
  62. ssl_certificate_key /etc/nginx/ssl/.../SSL_PrivateKEY....._$
  63.  
  64. location / {
  65. proxy_pass https://www.example.com:3000;
  66. proxy_http_version 1.1;
  67. proxy_set_header Upgrade $http_upgrade;
  68. proxy_set_header Connection 'upgrade';
  69. proxy_set_header Host $host;
  70. proxy_cache_bypass $http_upgrade;
  71. }
  72. }
  73.  
  74. new version
  75. var server = app.listen(app.get('port'), console.log('Express server listening on port'+app.get('port'))); // port is 3000
  76.  
  77. old version
  78. var server = https.createServer(options,app).listen( app.get('port'),function(){
  79. console.log('Express server listening on port'+app.get('port'));
  80. });
  81.  
  82. // I change it based on https://stackoverflow.com/questions/42761992/configuring-https-for-express-and-nginx
Add Comment
Please, Sign In to add comment