docker run -t -d -p 127.0.0.1:9980:9980 -e "domain=yourdomain\\.tld" \
-e "username=admin" -e "password=admin" --restart always --cap-add MKNOD collabora/code
| if (!-e $request_filename){ | |
| rewrite ^(.*)$ /index.php break; | |
| } | |
| # Media: images, icons, video, audio, HTC | |
| #location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ { | |
| # expires 1M; | |
| # access_log off; | |
| # log_not_found off; | |
| # add_header Pragma public; |
| cd /etc/udev/rules.drm 70-persistent-net.rules | |
| sed -i '/HWADDR*/d' /etc/sysconfig/network-scripts/ifcfg-eth0 | |
| sed -i '/UUID*/d' /etc/sysconfig/network-scripts/ifcfg-eth0 |
| ## to identify what services are running on your server use | |
| netstat -tulpn | |
| ## enable logging | |
| ufw logging on | |
| ## Use the default rules to allow outgoing traffic and to deny all incoming traffic. | |
| ufw default allow outgoing | |
| ufw default deny incoming |
| server { | |
| listen 80; | |
| listen [::]:80; | |
| server_name yourdomain.tld www.yourdomain.tld; | |
| return 301 https://yourdomain.tld$request_uri; | |
| } | |
| # modern configuration. tweak to your needs. | |
| ssl_protocols TLSv1.2; | |
| ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256'; | |
| ssl_prefer_server_ciphers on; | |
| ssl_dhparam /etc/nginx/ssl/dh4096.pem; | |
| # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months) | |
| add_header Strict-Transport-Security max-age=15768000; | |
| # Extra security headers |
| location ~* "(eval\()" { deny all; } | |
| location ~* "(127\.0\.0\.1)" { deny all; } | |
| location ~* "([a-z0-9]{2000})" { deny all; } | |
| location ~* "(javascript\:)(.*)(\;)" { deny all; } | |
| location ~* "(base64_encode)(.*)(\()" { deny all; } | |
| location ~* "(GLOBALS|REQUEST)(=|\[|%)" { deny all; } | |
| location ~* "(<|%3C).*script.*(>|%3)" { deny all; } | |
| location ~ "(\\|\.\.\.|\.\./|~|`|<|>|\|)" { deny all; } | |
| location ~* "(boot\.ini|etc/passwd|self/environ)" { deny all; } | |
| location ~* "(thumbs?(_editor|open)?|tim(thumb)?)\.php" { deny all; } |
| //remove queries from static assets | |
| function _remove_script_version( $src ){ | |
| $parts = explode( '?ver', $src ); | |
| return $parts[0]; | |
| } | |
| add_filter( 'script_loader_src', '_remove_script_version', 15, 1 ); | |
| add_filter( 'style_loader_src', '_remove_script_version', 15, 1 ); |
| # Enable Gzip compression | |
| gzip on; | |
| gzip_disable "msie6"; | |
| gzip_vary on; | |
| gzip_proxied any; | |
| gzip_comp_level 6; | |
| gzip_buffers 16 8k; | |
| gzip_http_version 1.1; | |
| gzip_types | |
| application/atom+xml |