mirror of
https://github.com/fmhy/edit.git
synced 2025-11-28 00:41:20 +11:00
added a reasonable nginx config as example in the selfhosted page
This commit is contained in:
parent
2d22602b70
commit
e588ff17c7
2 changed files with 34 additions and 1 deletions
29
.github/assets/nginx.conf
vendored
Normal file
29
.github/assets/nginx.conf
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
add_header X-Frame-Options "DENY";
|
||||||
|
add_header X-Content-Type-Options "nosniff";
|
||||||
|
add_header X-XSS-Protection "1; mode=block";
|
||||||
|
add_header Referrer-Policy "no-referrer-when-downgrade";
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~* \.(?:css|js|jpg|jpeg|gif|png|svg|ico|woff2?)$ {
|
||||||
|
expires 30d;
|
||||||
|
add_header Cache-Control "public";
|
||||||
|
}
|
||||||
|
|
||||||
|
error_log /var/log/nginx/error.log warn;
|
||||||
|
access_log /var/log/nginx/access.log;
|
||||||
|
}
|
||||||
|
|
||||||
|
gzip on;
|
||||||
|
gzip_types text/plain text/css application/javascript application/json image/svg+xml;
|
||||||
|
gzip_min_length 1000;
|
||||||
|
gzip_proxied any;
|
||||||
|
gzip_vary on;
|
||||||
|
|
@ -130,4 +130,8 @@ There are a few variables you can change if you wish to disable them:
|
||||||
|
|
||||||
# PowerShell
|
# PowerShell
|
||||||
rm -r -fo docs/.vitepress/cache
|
rm -r -fo docs/.vitepress/cache
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Reverse Proxy
|
||||||
|
|
||||||
|
You should be able to use any reverse proxy with this vitepress website, but find a reasonable config for an nginx server [in the repo here](https://github.com/fmhy/edit/blob/main/.github/assets/nginx.conf)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue