<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.gratiel.com/index.php?action=history&amp;feed=atom&amp;title=NextCloud%3A_NGINX</id>
	<title>NextCloud: NGINX - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.gratiel.com/index.php?action=history&amp;feed=atom&amp;title=NextCloud%3A_NGINX"/>
	<link rel="alternate" type="text/html" href="https://wiki.gratiel.com/index.php?title=NextCloud:_NGINX&amp;action=history"/>
	<updated>2026-10-14T20:54:40Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.32.1</generator>
	<entry>
		<id>https://wiki.gratiel.com/index.php?title=NextCloud:_NGINX&amp;diff=291&amp;oldid=prev</id>
		<title>Ewanchic: Created page with &quot;&lt;syntaxhighlight lang=&quot;bash&quot;&gt; upstream php-mynextcloud {     #server 127.0.0.1:9000;     server unix:/run/php/php7.1-fpm.sock; }  server {     listen 80;     listen [::]:80;...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.gratiel.com/index.php?title=NextCloud:_NGINX&amp;diff=291&amp;oldid=prev"/>
		<updated>2019-10-01T16:28:46Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt; upstream php-mynextcloud {     #server 127.0.0.1:9000;     server unix:/run/php/php7.1-fpm.sock; }  server {     listen 80;     listen [::]:80;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
upstream php-mynextcloud {&lt;br /&gt;
    #server 127.0.0.1:9000;&lt;br /&gt;
    server unix:/run/php/php7.1-fpm.sock;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
server {&lt;br /&gt;
    listen 80;&lt;br /&gt;
    listen [::]:80;&lt;br /&gt;
&lt;br /&gt;
    server_name mynextcloud.com;&lt;br /&gt;
&lt;br /&gt;
    # Add headers to serve security related headers&lt;br /&gt;
    add_header X-Content-Type-Options nosniff;&lt;br /&gt;
    add_header X-XSS-Protection &amp;quot;1; mode=block&amp;quot;;&lt;br /&gt;
    add_header X-Robots-Tag none;&lt;br /&gt;
    add_header X-Download-Options noopen;&lt;br /&gt;
    add_header X-Permitted-Cross-Domain-Policies none;&lt;br /&gt;
&lt;br /&gt;
    add_header Strict-Transport-Security &amp;quot;max-age=15768000; includeSubDomains; preload;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    #This header is already set in PHP, so it is commented out here.&lt;br /&gt;
    #add_header X-Frame-Options &amp;quot;SAMEORIGIN&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    # Path to the root of your installation&lt;br /&gt;
    root /var/html/www/nextcloud;&lt;br /&gt;
&lt;br /&gt;
    location = /robots.txt {&lt;br /&gt;
        allow all;&lt;br /&gt;
        log_not_found off;&lt;br /&gt;
        access_log off;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    # The following 2 rules are only needed for the user_webfinger app.&lt;br /&gt;
    # Uncomment it if you're planning to use this app.&lt;br /&gt;
    #rewrite ^/.well-known/host-meta /public.php?service=host-meta last;&lt;br /&gt;
    #rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json&lt;br /&gt;
    # last;&lt;br /&gt;
&lt;br /&gt;
    location = /.well-known/carddav {&lt;br /&gt;
        return 301 $scheme://$host/remote.php/dav;&lt;br /&gt;
    }&lt;br /&gt;
    location = /.well-known/caldav {&lt;br /&gt;
       return 301 $scheme://$host/remote.php/dav;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    location ~ /.well-known/acme-challenge {&lt;br /&gt;
      allow all;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    # set max upload size&lt;br /&gt;
    client_max_body_size 512M;&lt;br /&gt;
    fastcgi_buffers 64 4K;&lt;br /&gt;
&lt;br /&gt;
    # Disable gzip to avoid the removal of the ETag header&lt;br /&gt;
    #gzip off;&lt;br /&gt;
&lt;br /&gt;
    # Enable gzip but do not remove ETag headers&lt;br /&gt;
    gzip on;&lt;br /&gt;
    gzip_vary on;&lt;br /&gt;
    gzip_comp_level 4;&lt;br /&gt;
    gzip_min_length 256;&lt;br /&gt;
    gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;&lt;br /&gt;
    gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    # Uncomment if your server is build with the ngx_pagespeed module&lt;br /&gt;
    # This module is currently not supported.&lt;br /&gt;
    #pagespeed off;&lt;br /&gt;
&lt;br /&gt;
    error_page 403 /core/templates/403.php;&lt;br /&gt;
    error_page 404 /core/templates/404.php;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
       rewrite ^ /index.php$uri;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {&lt;br /&gt;
       deny all;&lt;br /&gt;
    }&lt;br /&gt;
    location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {&lt;br /&gt;
       deny all;&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
    location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) {&lt;br /&gt;
       include fastcgi_params;&lt;br /&gt;
       fastcgi_split_path_info ^(.+\.php)(/.*)$;&lt;br /&gt;
       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;&lt;br /&gt;
       fastcgi_param PATH_INFO $fastcgi_path_info;&lt;br /&gt;
       #Avoid sending the security headers twice&lt;br /&gt;
       fastcgi_param modHeadersAvailable true;&lt;br /&gt;
       fastcgi_param front_controller_active true;&lt;br /&gt;
       #fastcgi_pass unix:/run/php/php7.2-fpm.sock;&lt;br /&gt;
       fastcgi_pass php-mynextcloud;&lt;br /&gt;
       fastcgi_intercept_errors on;&lt;br /&gt;
       fastcgi_request_buffering off;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    location ~ ^/(?:updater|ocs-provider)(?:$|/) {&lt;br /&gt;
       try_files $uri/ =404;&lt;br /&gt;
       index index.php;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    # Adding the cache control header for js and css files&lt;br /&gt;
    # Make sure it is BELOW the PHP block&lt;br /&gt;
    location ~* \.(?:css|js)$ {&lt;br /&gt;
        try_files $uri /index.php$uri$is_args$args;&lt;br /&gt;
        #add_header Cache-Control &amp;quot;public, max-age=7200&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
        add_header Cache-Control &amp;quot;public, max-age=15778463&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
        # Add headers to serve security related headers (It is intended to&lt;br /&gt;
        # have those duplicated to the ones above)&lt;br /&gt;
        add_header X-Content-Type-Options nosniff;&lt;br /&gt;
        add_header X-XSS-Protection &amp;quot;1; mode=block&amp;quot;;&lt;br /&gt;
        add_header X-Robots-Tag none;&lt;br /&gt;
        add_header X-Download-Options noopen;&lt;br /&gt;
        add_header X-Permitted-Cross-Domain-Policies none;&lt;br /&gt;
        # Optional: Don't log access to assets&lt;br /&gt;
        access_log off;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$ {&lt;br /&gt;
        try_files $uri /index.php$uri$is_args$args;&lt;br /&gt;
        # Optional: Don't log access to other assets&lt;br /&gt;
        access_log off;&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ewanchic</name></author>
		
	</entry>
</feed>