Advertisement
hugoclo

Untitled

Dec 15th, 2018
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 10.88 KB | None | 0 0
  1. nginx: [warn] "ssl_stapling" ignored, issuer certificate not found for certificate "/etc/nginx/ssl/server.crt"
  2. nginx: [warn] conflicting server name "_" on 0.0.0.0:443, ignored
  3. nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
  4. nginx: configuration file /etc/nginx/nginx.conf test is successful
  5. # configuration file /etc/nginx/nginx.conf:
  6. user www-data;
  7. worker_processes auto;
  8. pid /var/run/nginx.pid;
  9.  
  10. events {
  11.     worker_connections 1024;
  12.     use epoll; # gestionnaire d'évènements epoll (kernel 2.6+)
  13. }
  14.  
  15. http {
  16.     include /etc/nginx/mime.types;
  17.     default_type  application/octet-stream;
  18.  
  19.     access_log /var/log/nginx/access.log combined;
  20.     error_log /var/log/nginx/error.log error;
  21.  
  22.     sendfile on;
  23.     keepalive_timeout 15;
  24.     keepalive_disable msie6;
  25.     keepalive_requests 100;
  26.     tcp_nopush on;
  27.     tcp_nodelay off;
  28.     server_tokens off;
  29.  
  30.     gzip on;
  31.     gzip_comp_level 5;
  32.     gzip_min_length 512;
  33.     gzip_buffers 4 8k;
  34.     gzip_proxied any;
  35.     gzip_vary on;
  36.     gzip_disable "msie6";
  37.     gzip_types
  38.         text/css
  39.         text/javascript
  40.         text/xml
  41.         text/plain
  42.         text/x-component
  43.         application/javascript
  44.         application/x-javascript
  45.         application/json
  46.         application/xml
  47.         application/rss+xml
  48.         application/vnd.ms-fontobject
  49.         font/truetype
  50.         font/opentype
  51.         image/svg+xml;
  52.  
  53.  
  54.     include /etc/nginx/sites-enabled/*.conf;
  55.     include /etc/nginx/ssl/params.conf;
  56. }
  57.  
  58.  
  59. # configuration file /etc/nginx/mime.types:
  60.  
  61. types {
  62.     text/html                                        html htm shtml;
  63.     text/css                                         css;
  64.     text/xml                                         xml;
  65.     image/gif                                        gif;
  66.     image/jpeg                                       jpeg jpg;
  67.     application/javascript                           js;
  68.     application/atom+xml                             atom;
  69.     application/rss+xml                              rss;
  70.  
  71.     text/mathml                                      mml;
  72.     text/plain                                       txt;
  73.     text/vnd.sun.j2me.app-descriptor                 jad;
  74.     text/vnd.wap.wml                                 wml;
  75.     text/x-component                                 htc;
  76.  
  77.     image/png                                        png;
  78.     image/svg+xml                                    svg svgz;
  79.     image/tiff                                       tif tiff;
  80.     image/vnd.wap.wbmp                               wbmp;
  81.     image/webp                                       webp;
  82.     image/x-icon                                     ico;
  83.     image/x-jng                                      jng;
  84.     image/x-ms-bmp                                   bmp;
  85.  
  86.     application/font-woff                            woff;
  87.     application/java-archive                         jar war ear;
  88.     application/json                                 json;
  89.     application/mac-binhex40                         hqx;
  90.     application/msword                               doc;
  91.     application/pdf                                  pdf;
  92.     application/postscript                           ps eps ai;
  93.     application/rtf                                  rtf;
  94.     application/vnd.apple.mpegurl                    m3u8;
  95.     application/vnd.google-earth.kml+xml             kml;
  96.     application/vnd.google-earth.kmz                 kmz;
  97.     application/vnd.ms-excel                         xls;
  98.     application/vnd.ms-fontobject                    eot;
  99.     application/vnd.ms-powerpoint                    ppt;
  100.     application/vnd.oasis.opendocument.graphics      odg;
  101.     application/vnd.oasis.opendocument.presentation  odp;
  102.     application/vnd.oasis.opendocument.spreadsheet   ods;
  103.     application/vnd.oasis.opendocument.text          odt;
  104.     application/vnd.openxmlformats-officedocument.presentationml.presentation
  105.                                                      pptx;
  106.     application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
  107.                                                      xlsx;
  108.     application/vnd.openxmlformats-officedocument.wordprocessingml.document
  109.                                                      docx;
  110.     application/vnd.wap.wmlc                         wmlc;
  111.     application/x-7z-compressed                      7z;
  112.     application/x-cocoa                              cco;
  113.     application/x-java-archive-diff                  jardiff;
  114.     application/x-java-jnlp-file                     jnlp;
  115.     application/x-makeself                           run;
  116.     application/x-perl                               pl pm;
  117.     application/x-pilot                              prc pdb;
  118.     application/x-rar-compressed                     rar;
  119.     application/x-redhat-package-manager             rpm;
  120.     application/x-sea                                sea;
  121.     application/x-shockwave-flash                    swf;
  122.     application/x-stuffit                            sit;
  123.     application/x-tcl                                tcl tk;
  124.     application/x-x509-ca-cert                       der pem crt;
  125.     application/x-xpinstall                          xpi;
  126.     application/xhtml+xml                            xhtml;
  127.     application/xspf+xml                             xspf;
  128.     application/zip                                  zip;
  129.  
  130.     application/octet-stream                         bin exe dll;
  131.     application/octet-stream                         deb;
  132.     application/octet-stream                         dmg;
  133.     application/octet-stream                         iso img;
  134.     application/octet-stream                         msi msp msm;
  135.  
  136.     audio/midi                                       mid midi kar;
  137.     audio/mpeg                                       mp3;
  138.     audio/ogg                                        ogg;
  139.     audio/x-m4a                                      m4a;
  140.     audio/x-realaudio                                ra;
  141.  
  142.     video/3gpp                                       3gpp 3gp;
  143.     video/mp2t                                       ts;
  144.     video/mp4                                        mp4;
  145.     video/mpeg                                       mpeg mpg;
  146.     video/quicktime                                  mov;
  147.     video/webm                                       webm;
  148.     video/x-flv                                      flv;
  149.     video/x-m4v                                      m4v;
  150.     video/x-mng                                      mng;
  151.     video/x-ms-asf                                   asx asf;
  152.     video/x-ms-wmv                                   wmv;
  153.     video/x-msvideo                                  avi;
  154. }
  155.  
  156. # configuration file /etc/nginx/sites-enabled/gateone.conf:
  157. map $http_upgrade $connection_upgrade {
  158.     default upgrade;
  159.     '' close;
  160. }
  161.  
  162. server {
  163.  listen 443 ssl;
  164.  server_name _;
  165.  
  166.  access_log /var/log/nginx/gateone-access.log;
  167.  error_log /var/log/nginx/gateone-error.log;
  168.  
  169.  auth_basic "Veuillez-vous authentifier";
  170.  auth_basic_user_file "/etc/nginx/passwd/rutorrent_passwd";
  171.  
  172.  # See https://wiki.mozilla.org/Security/Server_Side_TLS#Nginx
  173.  ssl_certificate /etc/nginx/ssl/server.crt;
  174.  ssl_certificate_key /etc/nginx/ssl/server.key;
  175.  
  176.  location /gateone {
  177.  
  178.  proxy_buffering off;
  179.  proxy_read_timeout 600s;
  180.  proxy_send_timeout 600s;
  181.  
  182.  proxy_set_header Host $host;
  183.  proxy_set_header X-Real-IP $remote_addr;
  184.  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  185.  
  186.  proxy_http_version 1.1;
  187.  proxy_set_header Upgrade $http_upgrade;
  188.  proxy_set_header Connection $connection_upgrade;
  189.  
  190.  proxy_pass http://127.0.0.1:8080;
  191.  }
  192.  
  193. }
  194.  
  195. # configuration file /etc/nginx/sites-enabled/nextcloud.conf:
  196. server {
  197.  
  198.     listen 80;
  199.     server_name cloud.hugoclo411.xyz;
  200.         return 301 https://$host$request_uri;
  201. }
  202.  
  203. server {
  204.         listen 443 ssl;
  205.         server_name cloud.hugoclo411.xyz;
  206.         index index.php;
  207.  
  208.         ssl on;
  209.     ssl_certificate /etc/letsencrypt/live/chat.hugoclo411.xyz/fullchain.pem; # managed by Certbot
  210.     ssl_certificate_key /etc/letsencrypt/live/chat.hugoclo411.xyz/privkey.pem; # managed by Certbot
  211.  
  212.         add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
  213.  
  214. #       include /etc/nginx/conf.d/ciphers.conf;                 #à désactiver si vous ne faites pas le tuto Logjam
  215. #       ssl_prefer_server_ciphers on;                                  #à activer si vous ne faites pas le tuto Logjam
  216. #       ssl_protocols TLSv1 TLSv1.1 TLSv1.2;             # à activer si vous ne faites pas le tuto Logjam
  217. #       ssl_ciphers 'AES256+EECDH:AES256+EDH';   #à activer si vous ne faites pas le tuto Logjam
  218. #       ssl_session_cache shared:SSL:10m; (limite la session ssl à 10mn, à activer ou non si vous le souhaitez.
  219.  
  220. #LOGS
  221.         access_log /var/log/nginx/nextcloud-access.log combined;
  222.         error_log /var/log/nginx/nextcloud-error.log error;
  223.  
  224. # root doit pointer vers le chemin d'installation de Nextcloud. Typiquement /var/www/nextcloud.
  225.     root /var/www/nextcloud;
  226.  
  227.         client_max_body_size 10G; # set max upload size
  228.         fastcgi_buffers 64 4K;
  229.  
  230. #rewrite url pour la synchronisation caldav/webdav.
  231.         rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
  232.         rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
  233.         rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
  234.  
  235.  
  236.         error_page 403 /core/templates/403.php;
  237.         error_page 404 /core/templates/404.php;
  238.  
  239. #eviter le référencement de votre cloud par google.
  240.         location = /robots.txt {
  241.                 allow all;
  242.                 log_not_found off;
  243.                 access_log off;
  244.         }
  245.  
  246. #interdire l'accès aux sous dossiers de nextcloud.
  247.         location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
  248.                 deny all;
  249.         }
  250.  
  251.         location / {
  252.                 # The following 2 rules are only needed with webfinger
  253.                 rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
  254.                 rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
  255.  
  256.                 rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
  257.                 rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
  258.  
  259.                 rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
  260.  
  261.                 try_files $uri $uri/ index.php;
  262.         }
  263.  
  264. #config php
  265.         location ~ ^(.+?\.php)(/.*)?$ {
  266.                 try_files $1 = 404;
  267.  
  268.                 include fastcgi_params;
  269.                 fastcgi_param SCRIPT_FILENAME $document_root$1;
  270.                 fastcgi_param PATH_INFO $2;
  271.                 fastcgi_pass unix:/var/run/php5-fpm.sock;
  272.         }
  273.  
  274. # Mise en cache des images
  275.         location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
  276.                 expires 30d;
  277.                 # Optional: Don’t log access to assets
  278.                 access_log off;
  279.         }
  280.  
  281.  
  282. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement