mirror of https://github.com/lissy93/dashy
⏩ Fast-forward to master
This commit is contained in:
commit
1466df0274
|
@ -619,6 +619,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
|
||||
|
@ -640,6 +642,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`
|
||||
|
||||
|
@ -654,6 +659,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:
|
||||
|
@ -666,6 +680,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
|
||||
|
|
|
@ -35,6 +35,16 @@ Header set X-Frame-Options: "ALLOW-FROM http://[dashy-location]/"
|
|||
|
||||
---
|
||||
|
||||
## 404 On Static Hosting
|
||||
|
||||
If you're seeing Dashy's 404 page on initial load/ refresh, and then the main app when you go back to Home, then this is likely caused by the Vue router, and if so can be fixed in one of two ways.
|
||||
|
||||
The first solution is to switch the routing mode, from HTML5 `history` mode to `hash` mode, by setting `appConfig.routingMode` to `hash`.
|
||||
|
||||
If this works, but you wish to continue using HTML5 history mode, then a bit of extra [server configuration](/docs/management.md#web-server-configuration) is required. This is explained in more detaail in the [Vue Docs](https://router.vuejs.org/guide/essentials/history-mode.html). Once completed, you can then use `routingMode: history` again, for neater URLs.
|
||||
|
||||
---
|
||||
|
||||
## Yarn Error
|
||||
|
||||
For more info, see [Issue #1](https://github.com/Lissy93/dashy/issues/1)
|
||||
|
|
Loading…
Reference in New Issue