playemulator.io-cache/0010-cache.conf

107 lines
3.7 KiB
Plaintext
Raw Permalink Normal View History

2024-07-26 00:36:17 +03:00
server {
listen 80;
server_name cdn.playemulator.io www.playemulator.io static.playemulator.io images.playemulator.io;
root /srv/playemulator/data;
index index.html index.htm;
# access_log /srv/steamcache/logs/access.log steamcache-default;
# error_log /srv/steamcache/logs/error.log;
proxy_temp_path /tmp/nginx/ 1 2;
resolver 8.8.8.8;
# location / {
# try_files $uri @mirror;
# # access_log /srv/steamcache/logs/access.log steamcache-local;
# }
location / {
proxy_next_upstream error timeout http_404;
proxy_pass http://$host$request_uri;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header X-Mirror-Upstream-Status $upstream_status;
add_header X-Mirror-Upstream-Response-Time $upstream_response_time;
add_header X-Mirror-Status $upstream_cache_status;
add_header Host $host;
# access_log /srv/steamcache/logs/access.log steamcache-other;
}
location @mirror {
proxy_store on;
proxy_store_access user:rw group:rw all:r;
proxy_next_upstream error timeout http_404;
proxy_pass https://$host;
#$request_uri;
proxy_redirect off;
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For proxy_add_x_forwarded_for;
# add_header X-Mirror-Upstream-Status $upstream_status;
# add_header X-Mirror-Upstream-Response-Time $upstream_response_time;
# add_header X-Mirror-Status $upstream_cache_status;
# access_log /srv/steamcache/logs/access.log steamcache-remote;
}
}
server {
listen 443 ssl http2;
proxy_cache default_cache;
server_name cdn.playemulator.io www.playemulator.io static.playemulator.io images.playemulator.io;
# ssl_certificate www.example.com.chained.crt;
# ssl_certificate_key www.example.com.key;
ssl_certificate /etc/ssl/local/cache.chained.crt;
ssl_certificate_key /etc/ssl/local/cache.key;
root /srv/playemulator/data;
index index.html index.htm;
# access_log /srv/steamcache/logs/access.log steamcache-default;
# error_log /srv/steamcache/logs/error.log;
proxy_temp_path /tmp/nginx/ 1 2;
resolver 8.8.8.8;
# location /uploads/games/ {
# try_files $uri @mirror;
# access_log /srv/playemulator/logs/access.log steamcache-local;
# }
location / {
proxy_next_upstream error timeout http_404;
proxy_pass https://$host$request_uri;
proxy_ssl_verify off;
proxy_ssl_server_name on;
proxy_ignore_headers "Set-Cookie";
proxy_hide_header "Set-Cookie";
proxy_buffering on;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header X-Mirror-Upstream-Status $upstream_status;
add_header X-Mirror-Upstream-Response-Time $upstream_response_time;
add_header X-Mirror-Status $upstream_cache_status;
add_header Host $host;
# access_log /srv/steamcache/logs/access.log steamcache-other;
}
location @mirror {
proxy_store on;
proxy_store_access user:rw group:rw all:r;
proxy_next_upstream error timeout http_404;
proxy_pass https://$host$request_uri;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For proxy_add_x_forwarded_for;
add_header X-Mirror-Upstream-Status $upstream_status;
add_header X-Mirror-Upstream-Response-Time $upstream_response_time;
add_header X-Mirror-Status $upstream_cache_status;
# access_log /srv/steamcache/logs/access.log steamcache-remote;
}
}