add nginx config example

This commit is contained in:
Aine 2024-11-18 10:15:32 +02:00
parent e394a7e186
commit ca2decda3a
No known key found for this signature in database
GPG key ID: 34969C908CCA2804

View file

@ -308,6 +308,30 @@ You have three options:
- move or symlink the `synapse-admin` into your vhosts root dir - move or symlink the `synapse-admin` into your vhosts root dir
- open the url of the vhost in your browser - open the url of the vhost in your browser
**Example config for nginx:**
Place it in `/etc/nginx/conf.d/synapse-admin.conf` (don't forget to replace server_name and root)
```conf
server {
listen 80;
listen [::]:80;
server_name example.com; # REPLACE with your domain
root /var/www/synapse-admin; # REPLACE with path where you extracted synapse admin
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
location ~* \.(?:css|js|jpg|jpeg|gif|png|svg|ico|woff|woff2|ttf|eot|webp)$ {
expires 30d; # Set caching for static assets
add_header Cache-Control "public";
}
gzip on;
gzip_types text/plain application/javascript application/json text/css text/xml application/xml+rss;
gzip_min_length 1000;
}
```
#### Steps for 2) #### Steps for 2)
- make sure you have installed the following: git, yarn, nodejs - make sure you have installed the following: git, yarn, nodejs