mirror of
https://github.com/Lissy93/dashy.git
synced 2024-10-04 17:57:30 +03:00
📝 Server config examples for Firebase, Caddy and Apache
This commit is contained in:
parent
d35bd9457b
commit
68640afc87
@ -617,6 +617,8 @@ Note, that if you choose not to use `server.js` to serve up the app, you will lo
|
||||
Example Configs
|
||||
- [NGINX](#nginx)
|
||||
- [Apache](#apache)
|
||||
- [Caddy](#caddy)
|
||||
- [Firebase](#firebase-hosting)
|
||||
- [cPanel](#cpanel)
|
||||
|
||||
### NGINX
|
||||
@ -638,6 +640,9 @@ server {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
To use HTML5 history mode (`appConfig.routingMode: history`), replace the inside of the location block with: `try_files $uri $uri/ /index.html;`.
|
||||
|
||||
Then upload the build contents of Dashy's dist directory to that location.
|
||||
For example: `scp -r ./dist/* [username]@[server_ip]:/var/www/dashy/html`
|
||||
|
||||
@ -652,6 +657,15 @@ In your Apache config, `/etc/apche2/apache2.conf` add:
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteBase /
|
||||
RewriteRule ^index\.html$ - [L]
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule . /index.html [L]
|
||||
</IfModule>
|
||||
```
|
||||
|
||||
Add a `.htaccess` file within `/var/www/html/dashy/.htaccess`, and add:
|
||||
@ -664,6 +678,39 @@ RewriteRule ^ index.html [QSA,L]
|
||||
|
||||
Then restart Apache, with `sudo systemctl restart apache2`
|
||||
|
||||
### Caddy
|
||||
|
||||
Caddy v2
|
||||
```
|
||||
try_files {path} /
|
||||
```
|
||||
|
||||
Caddy v1
|
||||
```
|
||||
rewrite {
|
||||
regexp .*
|
||||
to {path} /
|
||||
}
|
||||
```
|
||||
|
||||
### Firebase Hosting
|
||||
|
||||
Create a file names `firebase.json`, and populate it with something similar to:
|
||||
|
||||
```
|
||||
{
|
||||
"hosting": {
|
||||
"public": "dist",
|
||||
"rewrites": [
|
||||
{
|
||||
"source": "**",
|
||||
"destination": "/index.html"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### cPanel
|
||||
1. Login to your WHM
|
||||
2. Open 'Feature Manager' on the left sidebar
|
||||
@ -704,4 +751,4 @@ You can push your build image, by running: `docker push ghcr.io/OWNER/IMAGE_NAME
|
||||
|
||||
**[⬆️ Back to Top](#management)**
|
||||
|
||||
---
|
||||
---
|
||||
|
Loading…
Reference in New Issue
Block a user