nginx.conf 1.51 KB
Newer Older
Ilja's avatar
Ilja committed
1 2 3 4 5 6 7 8 9 10 11
    location / {
        # if you do not want remote frontends to be able to access your Pleroma backend
        # server, remove these lines.
        add_header 'Access-Control-Allow-Origin' '*' always;
        add_header 'Access-Control-Allow-Methods' 'POST, PUT, DELETE, GET, PATCH, OPTIONS' always;
        add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type, Idempotency-Key' always;
        add_header 'Access-Control-Expose-Headers' 'Link, X-RateLimit-Reset, X-RateLimit-Limit, X-RateLimit-Remaining, X-Request-Id' always;
        if ($request_method = OPTIONS) {
            return 204;
        }
        # stop removing lines here.
Ilja's avatar
Ilja committed
12

Ilja's avatar
Ilja committed
13 14 15 16 17 18 19 20 21
        add_header X-XSS-Protection "1; mode=block";
        add_header X-Permitted-Cross-Domain-Policies none;
        add_header X-Frame-Options DENY;
        add_header X-Content-Type-Options nosniff;
        add_header Referrer-Policy same-origin;
        add_header X-Download-Options noopen;
        
        # Uncomment this only after you get HTTPS working.
        # add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
Ilja's avatar
Ilja committed
22

Ilja's avatar
Ilja committed
23 24 25 26
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $http_host;
Ilja's avatar
Ilja committed
27

Ilja's avatar
Ilja committed
28
        proxy_pass http://localhost:4000;
Ilja's avatar
Ilja committed
29

Ilja's avatar
Ilja committed
30 31 32 33 34 35 36 37 38
        client_max_body_size 16m;
    }

    location /proxy {
        proxy_cache pleroma_media_cache;
        proxy_cache_lock on;
        proxy_ignore_client_abort on;
        proxy_pass http://localhost:4000;
    }