server { listen 80; server_name _; root /usr/share/nginx/html; index index.html; location = /oo-preview.html { if_modified_since off; etag off; add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0" always; add_header Pragma "no-cache" always; add_header Expires "0" always; } location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff2?|ttf|eot)$ { expires 30d; add_header Cache-Control "public, immutable"; } location /pdfs/ { alias /data/pdfs/; add_header Content-Disposition "inline"; add_header X-Content-Type-Options "nosniff"; add_header Cache-Control "no-store"; } location /excels/ { alias /data/excels/; add_header X-Frame-Options "SAMEORIGIN"; add_header Cache-Control "no-store"; } location /words/ { alias /data/words/; add_header X-Frame-Options "SAMEORIGIN"; add_header Cache-Control "no-store"; } location /raw/excels/ { alias /data/raw_excels/; add_header Cache-Control "no-store"; } location /raw/words/ { alias /data/raw_words/; add_header Cache-Control "no-store"; } location /raw/files/ { alias /data/uploads/; add_header Cache-Control "no-store"; } location = /onlyoffice-callback { default_type application/json; add_header Cache-Control "no-store" always; return 200 '{"error":0}'; } location ^~ /onlyoffice/ { proxy_pass http://onlyoffice:80/; proxy_http_version 1.1; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $http_host; proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header X-Real-IP $remote_addr; proxy_read_timeout 3600; proxy_send_timeout 3600; proxy_buffering off; } location ^~ /cache/ { proxy_pass http://onlyoffice:80/cache/; proxy_http_version 1.1; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $http_host; proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; proxy_read_timeout 3600; proxy_send_timeout 3600; proxy_buffering off; } location / { try_files $uri $uri/ $uri.html =404; } error_page 404 /404.html; }