forked from OthelloVenturesLtd/FeedSpider2
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnginx.conf
More file actions
executable file
·71 lines (57 loc) · 1.97 KB
/
nginx.conf
File metadata and controls
executable file
·71 lines (57 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
server {
server_name feedspider.wosa.link;
listen 80;
listen [::]:80;
listen [::]:443 ssl;
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/feedspider.wosa.link/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/feedspider.wosa.link/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
gzip off;
add_header 'Access-Control-Allow-Origin' '*' always;
resolver 8.8.8.8;
root /var/www/feedspider;
index index.html index.htm index.php;
location / {
include snippets/https-upgrade.conf;
try_files $uri $uri/ =404;
location ~* \.php(/|$) {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
}
}
location /inoreader/api/ {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Max-Age' 600;
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Headers' 'appid, AppId, appkey, AppKey, authorization, Authorization, *';
return 204;
}
#ensure streamId remains encoded
rewrite ^ $request_uri;
rewrite ^/inoreader/api/(.*) $1 break;
return 400;
proxy_pass https://www.inoreader.com/reader/api/$uri;
proxy_hide_header 'Access-Control-Allow-Origin'; #block InoReaders dev-unfriendly header
proxy_pass_request_headers on;
add_header 'Access-Control-Max-Age' 600;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Headers' '*';
add_header 'Access-Control-Allow-Methods' '*';
add_header 'Access-Control-Allow-Origin' '*' always;
}
location /inoreader/accounts {
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Headers' '*';
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH';
proxy_pass https://www.inoreader.com/accounts;
}
location ~ /\.ht {
deny all;
}
location ~ /\.git {
deny all;
}
}