Advertisement
Guest User

Untitled

a guest
Apr 24th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.33 KB | None | 0 0
  1.  
  2.  
  3. =====NGINX.CONF=====
  4. # Version=1.0
  5. user www-data;
  6. worker_processes auto;
  7. pid /run/nginx.pid;
  8.  
  9. events {
  10. worker_connections 768;
  11. # multi_accept on;
  12. }
  13.  
  14. http {
  15.  
  16. ##
  17. # Basic Settings
  18. ##
  19.  
  20. sendfile on;
  21. tcp_nopush on;
  22. tcp_nodelay on;
  23. keepalive_timeout 65;
  24. types_hash_max_size 2048;
  25. # server_tokens off;
  26.  
  27. server_names_hash_bucket_size 128;
  28. # server_name_in_redirect off;
  29.  
  30. include /etc/nginx/mime.types;
  31. default_type application/octet-stream;
  32.  
  33. ##
  34. # SSL Settings
  35. ##
  36.  
  37. ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
  38. ssl_prefer_server_ciphers on;
  39.  
  40. ##
  41. # Logging Settings
  42. ##
  43.  
  44. access_log /var/log/nginx/access.log;
  45. error_log /var/log/nginx/error.log;
  46.  
  47. ##
  48. # Gzip Settings
  49. ##
  50.  
  51. gzip on;
  52. gzip_disable "msie6";
  53.  
  54. # gzip_vary on;
  55. # gzip_proxied any;
  56. # gzip_comp_level 6;
  57. # gzip_buffers 16 8k;
  58. # gzip_http_version 1.1;
  59. # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
  60.  
  61. ##
  62. # Virtual Host Configs
  63. ##
  64.  
  65. include /etc/nginx/conf.d/*.conf;
  66. include /etc/nginx/sites-enabled/*;
  67. }
  68.  
  69.  
  70. #mail {
  71. # # See sample authentication script at:
  72. # # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
  73. #
  74. # # auth_http localhost/auth.php;
  75. # # pop3_capabilities "TOP" "USER";
  76. # # imap_capabilities "IMAP4rev1" "UIDPLUS";
  77. #
  78. # server {
  79. # listen localhost:110;
  80. # protocol pop3;
  81. # proxy on;
  82. # }
  83. #
  84. # server {
  85.  
  86. //====NGINX.CONF
  87.  
  88. -------------------------------------------------------------------------------------
  89.  
  90. ====Atomic.Conf(Sites-Enabled)
  91.  
  92. # Version=2.0
  93. server {
  94. listen 443 ssl http2;
  95. listen [::]:443 ssl http2;
  96. server_name [SERVER NAME(REPLACED];
  97. access_log /var/log/nginx/AtoMiC-ToolKit-configured-sites.access.log;
  98. error_log /var/log/nginx/AtoMiC-ToolKit-configured-sites.error.log;
  99. root /var/www/;
  100. index index.html index.php;
  101.  
  102. client_body_buffer_size 128k;
  103. client_max_body_size 100M;
  104. send_timeout 5m;
  105.  
  106.  
  107.  
  108.  
  109. ##
  110. # Gzip Settings
  111. ##
  112.  
  113. gzip on;
  114. gzip_buffers 16 8k;
  115. gzip_comp_level 6;
  116. gzip_disable "MSIE [1-6]\.";
  117. gzip_http_version 1.1;
  118. gzip_min_length 1000;
  119. gzip_proxied any;
  120. gzip_types application/javascript application/json application/xml application/xml+rss image/svg+xml text/css text/javascript text/plain text/xml;
  121. gzip_vary on;
  122.  
  123. ##
  124. # SSL Settings
  125. ##
  126.  
  127. # # Reference: https://cipherli.st/ using certain less secure settings for compatibility with older devices
  128. ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:ECDHE-RSA-AES128-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA128:DHE-RSA-AES128-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA128:ECDHE-RSA-AES128-SHA384:ECDHE-RSA-AES128-SHA128:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES128-SHA:D$
  129. ssl_ecdh_curve prime256v1; # Less secure for compatibility
  130. ssl_prefer_server_ciphers on;
  131. ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Less secure for compatibility
  132. ssl_session_cache shared:SSL:10m;
  133. ssl_session_tickets off;
  134. ssl_session_timeout 10m;
  135. ssl_stapling on;
  136. ssl_stapling_verify on;
  137. # # Enable this manually after running the commended command at the end of the line (takes a long time)
  138. # ssl_dhparam /etc/nginx/dhparam.pem; # openssl dhparam -out /etc/nginx/dhparam.pem 4096
  139. # # WARNING: Only enable Strict Transport after confirming HTTPS is working
  140. # add_header Strict-Transport-Security "max-age=15768000; includeSubdomains; preload"; # 15768000 = 6 months
  141. add_header X-Content-Type-Options nosniff;
  142. add_header X-Frame-Options SAMEORIGIN; # Not using DENY because Organizr uses frames
  143. add_header X-XSS-Protection "1; mode=block";
  144. add_header X-Robots-Tag none;
  145.  
  146. ##
  147. # LetsEncrypt Config
  148. ##
  149.  
  150. location ~ ^/\.well-known {
  151. root /var/www/letsencrypt;
  152. allow all;
  153. }
  154.  
  155. location / {
  156. if ($scheme != https) {
  157. # # Uncomment this line after configuring certbot https://certbot.eff.org/
  158. #return 301 https://$host$request_uri;
  159. }
  160. }
  161.  
  162. ###
  163. #REDIRECT
  164. ###
  165. rewrite ^/$ https://[SERVERNAME(Replaced)]/organizr/ redirect;
  166.  
  167. ##
  168. # Proxy Config
  169. ##
  170.  
  171. proxy_bind $server_addr;
  172. proxy_buffers 32 4k;
  173. proxy_hide_header X-Frame-Options;
  174. proxy_http_version 1.1;
  175. proxy_next_upstream error timeout invalid_header http_500 http_502 http_503; # Timeout if the real server is dead
  176. proxy_no_cache $cookie_session;
  177. proxy_read_timeout 240;
  178. proxy_redirect http:// $scheme://;
  179. proxy_send_timeout 240;
  180. proxy_set_header Connection "upgrade";
  181. proxy_set_header Host $host:$server_port;
  182. proxy_set_header Upgrade $http_upgrade;
  183. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  184. proxy_set_header X-Forwarded-Host $host;
  185. proxy_set_header X-Forwarded-Proto $scheme;
  186. proxy_set_header X-Forwarded-Ssl on;
  187. proxy_set_header X-Real-IP $remote_addr;
  188.  
  189. ##
  190. # PHP Config
  191. ##
  192.  
  193. location ~ \.php$ {
  194. try_files $uri =404;
  195. include fastcgi_params;
  196. fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
  197. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  198. }
  199.  
  200. ##
  201. # App Location Config
  202. ##
  203.  
  204. location /auth-user{
  205. internal;
  206. proxy_pass https://bossbox.ddns.net/auth.php?user;
  207. proxy_pass_request_body off;
  208. proxy_set_header Content-Length "";
  209. proxy_set_header X-Original-URI $request_uri;
  210. }
  211.  
  212. include /etc/nginx/locations-enabled/*.atomic.conf;
  213.  
  214. ssl_certificate /etc/letsencrypt/live/bossbox.ddns.net/fullchain.pem; # managed by Certbot
  215. ssl_certificate_key /etc/letsencrypt/live/bossbox.ddns.net/privkey.pem; # managed by Certbot
  216. }
  217.  
  218. server {
  219. if ($host = [Servername(replaced)]) {
  220. return 301 https://$host$request_uri;
  221. } # managed by Certbot
  222.  
  223.  
  224. listen 80;
  225. listen [::]:80;
  226. server_name [Servername(replaced)];
  227. return 404; # managed by Certbot
  228.  
  229.  
  230. }
  231. //====Atomic.Conf(Sites-Enabled)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement