Guest User

nginx ssl setup

a guest
Nov 6th, 2015
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.99 KB | None | 0 0
  1.  
  2. #user nobody;
  3. worker_processes 1;
  4.  
  5. #error_log logs/error.log;
  6. #error_log logs/error.log notice;
  7. #error_log logs/error.log info;
  8.  
  9. #pid logs/nginx.pid;
  10.  
  11.  
  12. events {
  13. worker_connections 1024;
  14. }
  15.  
  16.  
  17. http {
  18. include mime.types;
  19. default_type application/octet-stream;
  20.  
  21. #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  22. # '$status $body_bytes_sent "$http_referer" '
  23. # '"$http_user_agent" "$http_x_forwarded_for"';
  24.  
  25. #access_log logs/access.log main;
  26.  
  27. sendfile on;
  28. #tcp_nopush on;
  29.  
  30. #keepalive_timeout 0;
  31. keepalive_timeout 65;
  32.  
  33. #gzip on;
  34.  
  35. server {
  36. listen 80;
  37. listen 443 ssl;
  38. server_name mydomain.com, 192.168.0.21;
  39.  
  40.  
  41.  
  42. ssl_certificate ssl/mydomain.crt;
  43. ssl_certificate_key ssl/mydomain.key;
  44. ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
  45. ssl_prefer_server_ciphers on;
  46. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  47. ssl_session_cache shared:SSL:10m;
  48. ssl_dhparam ssl/dhparam.pem;
  49.  
  50.  
  51.  
  52. #charset koi8-r;
  53.  
  54. #access_log logs/host.access.log main;
  55.  
  56. location /nzbget {
  57. proxy_pass http://192.168.0.21:6789;
  58. proxy_set_header Host $host;
  59. proxy_set_header X-Real-IP $remote_addr;
  60. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  61.  
  62. }
  63.  
  64. location /plexpy {
  65. proxy_pass http://127.0.0.1:8181/plexpy;
  66. proxy_set_header Host $host;
  67. proxy_set_header X-Real-IP $remote_addr;
  68. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  69. auth_basic "closed site";
  70. auth_basic_user_file .htpasswd;
  71. }
  72.  
  73. location /comics {
  74. proxy_pass http://127.0.0.1:8090;
  75. proxy_set_header Host $host;
  76. proxy_set_header X-Real-IP $remote_addr;
  77. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  78. auth_basic "closed site";
  79. auth_basic_user_file .htpasswd;
  80. }
  81.  
  82.  
  83. location /htpc {
  84. proxy_pass http://127.0.0.1:8085;
  85. proxy_set_header Host $host;
  86. proxy_set_header X-Real-IP $remote_addr;
  87. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  88. auth_basic "closed site";
  89. auth_basic_user_file .htpasswd;
  90. }
  91.  
  92. location /sonarr {
  93. proxy_pass http://127.0.0.1:8989;
  94. proxy_set_header Host $host;
  95. proxy_set_header X-Real-IP $remote_addr;
  96. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  97. auth_basic "closed site";
  98. auth_basic_user_file .htpasswd;
  99.  
  100. }
  101. location /movies {
  102. proxy_pass http://127.0.0.1:5050;
  103. proxy_set_header Host $host;
  104. proxy_set_header X-Real-IP $remote_addr;
  105. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  106. auth_basic "closed site";
  107. auth_basic_user_file .htpasswd;
  108.  
  109.  
  110. }
  111. location /torrent {
  112. proxy_pass http://127.0.0.1:31810;
  113. proxy_set_header Host $host;
  114. proxy_set_header X-Real-IP $remote_addr;
  115. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  116. auth_basic "closed site";
  117. auth_basic_user_file .htpasswd;
  118.  
  119.  
  120.  
  121. }
  122.  
  123.  
  124. location / {
  125. root html;
  126. index index.html index.htm;
  127. }
  128.  
  129. #error_page 404 /404.html;
  130.  
  131. # redirect server error pages to the static page /50x.html
  132. #
  133. error_page 500 502 503 504 /50x.html;
  134. location = /50x.html {
  135. root html;
  136. }
  137.  
  138. # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  139. #
  140. #location ~ \.php$ {
  141. # proxy_pass http://127.0.0.1;
  142. #}
  143.  
  144. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  145. #
  146. #location ~ \.php$ {
  147. # root html;
  148. # fastcgi_pass 127.0.0.1:9000;
  149. # fastcgi_index index.php;
  150. # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
  151. # include fastcgi_params;
  152. #}
  153.  
  154. # deny access to .htaccess files, if Apache's document root
  155. # concurs with nginx's one
  156. #
  157. #location ~ /\.ht {
  158. # deny all;
  159. #}
  160. }
  161.  
  162.  
  163. # another virtual host using mix of IP-, name-, and port-based configuration
  164. #
  165. #server {
  166. # listen 8000;
  167. # listen somename:8080;
  168. # server_name somename alias another.alias;
  169.  
  170. # location / {
  171. # root html;
  172. # index index.html index.htm;
  173. # }
  174. #}
  175.  
  176.  
  177. # HTTPS server
  178. #
  179. #server {
  180. # listen 443 ssl;
  181. # server_name localhost;
  182.  
  183. # ssl_certificate cert.pem;
  184. # ssl_certificate_key cert.key;
  185.  
  186. # ssl_session_cache shared:SSL:1m;
  187. # ssl_session_timeout 5m;
  188.  
  189. # ssl_ciphers HIGH:!aNULL:!MD5;
  190. # ssl_prefer_server_ciphers on;
  191.  
  192. # location / {
  193. # root html;
  194. # index index.html index.htm;
  195. # }
  196. #}
  197.  
  198. }
Advertisement
Add Comment
Please, Sign In to add comment