|
1 | | -# Default Nginx configuration |
2 | 1 | user nginx; |
3 | 2 | worker_processes auto; |
4 | 3 | error_log /var/log/nginx/error.log warn; |
@@ -38,41 +37,47 @@ http { |
38 | 37 | gzip on; |
39 | 38 | gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; |
40 | 39 |
|
41 | | - # Specify DNS resolver for variables, this is Google Public DNS |
42 | | - resolver 8.8.8.8 8.8.4.4 [2001:4860:4860::]:8888 [2001:4860:4860::]:8844 valid=300s; |
43 | | - resolver_timeout 5s; # Timeout for DNS resolution |
44 | | - |
45 | | - location ~ ^/hog/static/(.*)$ { |
46 | | - # Check Referer header |
47 | | - set $valid_referer 0; |
48 | | - if ($http_referer ~* "^https?://(localhost|([a-zA-Z0-9-]+)\.?vivekraman\.dev)") { |
49 | | - set $valid_referer 1; |
50 | | - } |
51 | | - if ($valid_referer = 0) { |
52 | | - return 403; # Return forbidden if the Referer header is invalid |
53 | | - } |
54 | | - |
55 | | - set $posthog_static "https://us-assets.i.posthog.com/static/"; |
56 | | - # use variable to force proper DNS re-resolution, also must manually pass along path |
57 | | - proxy_pass $posthog_static$1$is_args$args; |
58 | | - proxy_set_header Host "us-assets.i.posthog.com"; |
59 | | - } |
60 | | - |
61 | | - location ~ ^/hog/(.*)$ { |
62 | | - # Check Referer header |
63 | | - set $valid_referer 0; |
64 | | - if ($http_referer ~* "^https?://(localhost|([a-zA-Z0-9-]+)\.?vivekraman\.dev)") { |
65 | | - set $valid_referer 1; |
66 | | - } |
67 | | - if ($valid_referer = 0) { |
68 | | - return 403; # Return forbidden if the Referer header is invalid |
69 | | - } |
70 | | - |
71 | | - set $posthog_main "https://us.i.posthog.com/"; |
72 | | - # use variable to force proper DNS re-resolution, also must manually pass along path |
73 | | - proxy_pass $posthog_main$1$is_args$args; |
74 | | - proxy_set_header Host "us.i.posthog.com"; |
75 | | - } |
| 40 | + # Specify DNS resolver for variables |
| 41 | + # resolver 8.8.8.8 8.8.4.4 1.1.1.1 1.0.0.1 valid=300s; |
| 42 | + # resolver_timeout 5s; # Timeout for DNS resolution |
| 43 | + |
| 44 | + # location ~ ^/hog/static/(.*)$ { |
| 45 | + # # Check Referer header |
| 46 | + # set $valid_referer 0; |
| 47 | + # if ($http_referer ~* "^https?://(localhost|([a-zA-Z0-9-]+)\.?vivekraman\.dev)") { |
| 48 | + # set $valid_referer 1; |
| 49 | + # } |
| 50 | + # if ($valid_referer = 0) { |
| 51 | + # return 403; # Return forbidden if the Referer header is invalid |
| 52 | + # } |
| 53 | + |
| 54 | + # set $posthog_static "https://us-assets.i.posthog.com/static/"; |
| 55 | + # # use variable to force proper DNS re-resolution, also must manually pass along path |
| 56 | + # proxy_pass $posthog_static$1$is_args$args; |
| 57 | + # proxy_set_header Host "us-assets.i.posthog.com"; |
| 58 | + # proxy_ssl_server_name on; |
| 59 | + # proxy_set_header Cookie $http_cookie; |
| 60 | + # proxy_set_header Authorization $http_authorization; |
| 61 | + # } |
| 62 | + |
| 63 | + # location ~ ^/hog/(.*)$ { |
| 64 | + # # Check Referer header |
| 65 | + # set $valid_referer 0; |
| 66 | + # if ($http_referer ~* "^https?://(localhost:?[0-9]*|([a-zA-Z0-9-]+)\.?vivekraman\.dev)") { |
| 67 | + # set $valid_referer 1; |
| 68 | + # } |
| 69 | + # if ($valid_referer = 0) { |
| 70 | + # return 403; # Return forbidden if the Referer header is invalid |
| 71 | + # } |
| 72 | + |
| 73 | + # set $posthog_main "https://us.i.posthog.com/"; |
| 74 | + # # use variable to force proper DNS re-resolution, also must manually pass along path |
| 75 | + # proxy_pass $posthog_main$1$is_args$args; |
| 76 | + # proxy_set_header Host "us.i.posthog.com"; |
| 77 | + # proxy_ssl_server_name on; |
| 78 | + # proxy_set_header Cookie $http_cookie; |
| 79 | + # proxy_set_header Authorization $http_authorization; |
| 80 | + # } |
76 | 81 |
|
77 | 82 | # Error pages |
78 | 83 | error_page 500 502 503 504 /50x.html; |
|
0 commit comments