Advertisement
Guest User

Untitled

a guest
Jan 7th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #upstream php {
  2. # server 127.0.0.1:9000;
  3. #}
  4.  
  5. server {
  6. listen 80 default_server;
  7. listen [::]:80 default_server;
  8. server_name dom.herfort.eu www.dom.herfort.eu;
  9. # return 301 https://$server_name$request_uri;
  10. location / {
  11. rewrite ^ https://$host$request_uri? permanent;
  12. }
  13.  
  14. location /tv {
  15. proxy_pass http://127.0.0.1:9981;
  16. proxy_redirect off;
  17. proxy_set_header Host $host;
  18. proxy_set_header X-Real-IP $remote_addr;
  19. proxy_set_header X-Forwarded-For $remote_addr;
  20. }
  21. }
  22.  
  23. server {
  24. # SSL configuration
  25. listen 443 ssl http2 default_server;
  26. listen [::]:443 ssl http2 default_server;
  27. include snippets/ssl-dom.herfort.eu.conf;
  28. include snippets/ssl-params.conf;
  29.  
  30. root /media/MedienPlatte/nextcloud;
  31.  
  32. add_header X-Content-Type-Options nosniff;
  33. add_header X-Frame-Options "SAMEORIGIN";
  34. add_header X-XSS-Protection "1; mode=block";
  35. add_header X-Robots-Tag none;
  36. add_header X-Download-Options noopen;
  37. add_header X-Permitted-Cross-Domain-Policies none;
  38.  
  39. access_log /var/log/nginx/nextcloud.access.log;
  40. error_log /var/log/nginx/nextcloud.error.log;
  41.  
  42. # -----------------------------------------------------------------------------
  43. # ------------------------ TV-Headend Server ----------------------------------
  44. location /tv {
  45. proxy_headers_hash_max_size 51200;
  46. proxy_headers_hash_bucket_size 6400;
  47. proxy_pass http://127.0.0.1:9981;
  48. proxy_redirect off;
  49. proxy_set_header Host $host;
  50. proxy_set_header X-Real-IP $remote_addr;
  51. proxy_set_header X-Forwarded-For $remote_addr;
  52. }
  53. # -----------------------------------------------------------------------------
  54. # ------------------------ PHPmyAdmin -----------------------------------------
  55. location /phpmyadmin {
  56. root /usr/share/;
  57. index index.php;
  58. try_files $uri $uri/ =404;
  59.  
  60. location ~ ^/phpmyadmin/(doc|sql|setup)/ {
  61. deny all;
  62. }
  63.  
  64. location ~ /phpmyadmin/(.+\.php)$ {
  65. fastcgi_pass unix:/run/php/php7.0-fpm.sock;
  66. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  67. include fastcgi_params;
  68. include snippets/fastcgi-php.conf;
  69. }
  70. }
  71. # -----------------------------------------------------------------------------
  72.  
  73. location = /robots.txt {
  74. allow all;
  75. log_not_found off;
  76. access_log off;
  77. }
  78.  
  79. location = /.well-known/carddav {
  80. return 301 $scheme://$host/remote.php/dav;
  81. }
  82. location = /.well-known/caldav {
  83. return 301 $scheme://$host/remote.php/dav;
  84. }
  85.  
  86. client_max_body_size 512M;
  87. fastcgi_buffers 8 16K;
  88. fastcgi_buffer_size 32k;
  89. fastcgi_connect_timeout 300;
  90. fastcgi_send_timeout 300;
  91. fastcgi_read_timeout 300;
  92. gzip off;
  93.  
  94. error_page 403 /core/templates/403.php;
  95. error_page 404 /core/templates/404.php;
  96.  
  97.  
  98. location / {
  99. rewrite ^ /index.php$uri;
  100. }
  101.  
  102. location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
  103. deny all;
  104. }
  105.  
  106. location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
  107. deny all;
  108. }
  109.  
  110. location ~^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?$
  111. include fastcgi_params;
  112. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  113. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  114. fastcgi_param PATH_INFO $fastcgi_path_info;
  115. fastcgi_param HTTPS on;
  116. #Avoid sending the security headers twice
  117. fastcgi_param modHeadersAvailable true;
  118. fastcgi_param front_controller_active true;
  119. fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
  120. fastcgi_intercept_errors on;
  121. fastcgi_request_buffering off;
  122. }
  123. location ~ ^/(?:updater|ocs-provider)(?:$|/) {
  124. try_files $uri/ =404;
  125. index index.php;
  126. }
  127.  
  128. location ~* \.(?:css|js)$ {
  129. try_files $uri /index.php$uri$is_args$args;
  130. add_header Cache-Control "public, max-age=7200";
  131. add_header X-Content-Type-Options nosniff;
  132. add_header X-Frame-Options "SAMEORIGIN";
  133. add_header X-XSS-Protection "1; mode=block";
  134. add_header X-Robots-Tag none;
  135. add_header X-Download-Options noopen;
  136. add_header X-Permitted-Cross-Domain-Policies none;
  137. # Optional: Don't log access to assets
  138. access_log off;
  139. }
  140.  
  141. location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$ {
  142. try_files $uri /index.php$uri$is_args$args;
  143. access_log off;
  144. }
  145.  
  146. location ~ /\.ht {
  147. deny all;
  148. }
  149. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement