feat(domain): separate POS to pos.nexusautoparts.com.mx subdomain

- nexusautoparts.com.mx -> Dashboard/Landing (port 5000)
- pos.nexusautoparts.com.mx -> POS (port 5001) with static assets proxy
- admin.nexusautoparts.com.mx -> Dashboard (port 5000)
- Update mobile app configs to point to pos.nexusautoparts.com.mx
- Update Caddy docs with new subdomain layout
This commit is contained in:
2026-05-14 09:30:43 +00:00
parent 6734993508
commit e61063bdd7
4 changed files with 44 additions and 6 deletions

View File

@@ -6,12 +6,17 @@
Add this to `/etc/caddy/Caddyfile` on the Caddy VM (192.168.10.74):
```caddyfile
# Main POS domain
# Landing page / Dashboard
nexusautoparts.com.mx, www.nexusautoparts.com.mx {
reverse_proxy 192.168.10.91:80
}
# Admin dashboard subdomain
# POS (point of sale app)
pos.nexusautoparts.com.mx {
reverse_proxy 192.168.10.91:80
}
# Dashboard admin (optional alternative access)
admin.nexusautoparts.com.mx {
reverse_proxy 192.168.10.91:80
}
@@ -30,3 +35,12 @@ sudo caddy reload --config /etc/caddy/Caddyfile
```
Caddy will automatically obtain Let's Encrypt certificates for all domains.
## DNS Records needed in Hostinger
| Record | Name | Target |
|---|---|---|
| A | @ | IP of Caddy VM |
| CNAME | www | nexusautoparts.com.mx |
| CNAME | pos | nexusautoparts.com.mx |
| CNAME | admin | nexusautoparts.com.mx |

View File

@@ -10,7 +10,7 @@ upstream nexus_quart {
server 127.0.0.1:5002;
}
# ─── POS (primary domain) ───
# ─── Landing page / Dashboard (primary domain) ───
server {
listen 80;
server_name nexusautoparts.com.mx www.nexusautoparts.com.mx;
@@ -24,6 +24,30 @@ server {
gzip_comp_level 6;
gzip_types text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml;
location / {
proxy_pass http://nexus_dashboard;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 300s;
}
}
# ─── POS (dedicated subdomain) ───
server {
listen 80;
server_name pos.nexusautoparts.com.mx;
client_max_body_size 10M;
# Gzip compression
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_types text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml;
# Static assets with caching (proxy to Flask)
location /pos/static/ {
proxy_pass http://nexus_pos;
@@ -63,7 +87,7 @@ server {
}
}
# ─── Dashboard (admin subdomain) ───
# ─── Dashboard admin (alternative access) ───
server {
listen 80;
server_name admin.nexusautoparts.com.mx;

View File

@@ -3,7 +3,7 @@
"appName": "Nexus POS",
"webDir": "www",
"server": {
"url": "https://nexusautoparts.com.mx/pos",
"url": "https://pos.nexusautoparts.com.mx/pos",
"cleartext": true
},
"plugins": {

View File

@@ -8,7 +8,7 @@
## Architecture
The Capacitor app loads the POS from the remote server at
`https://nexusautoparts.com.mx/pos`. This means:
`https://pos.nexusautoparts.com.mx/pos`. This means:
- The app requires internet on first load.
- The PWA service worker handles offline caching after that.
- No HTML/JS/CSS is bundled into the native binary.