fix: Fastify on 0.0.0.0, remove vueDevTools, nginx API proxy config
- Fastify listens on 0.0.0.0:3050 (was 127.0.0.1, blocked nginx proxy) - Remove vite-plugin-vue-devtools (was causing silent page reloads) - Add asciinator.conf with working nginx config (API proxy strips /api/ prefix) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e904cdb3cb
commit
a95c184be7
49
asciinator.conf
Normal file
49
asciinator.conf
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
map $http_upgrade $connection_upgrade {
|
||||||
|
default upgrade;
|
||||||
|
'' close;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name asciinator.waynehayesdevelopment.com;
|
||||||
|
location /.well-known/acme-challenge/ {
|
||||||
|
root /var/www/certbot;
|
||||||
|
}
|
||||||
|
location / {
|
||||||
|
return 301 https://$host$request_uri;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 443 ssl http2;
|
||||||
|
listen [::]:443 ssl http2;
|
||||||
|
server_name asciinator.waynehayesdevelopment.com;
|
||||||
|
client_max_body_size 25m;
|
||||||
|
ssl_certificate /etc/letsencrypt/live/asciinator.waynehayesdevelopment.com/fullchain.pem;
|
||||||
|
ssl_certificate_key /etc/letsencrypt/live/asciinator.waynehayesdevelopment.com/privkey.pem;
|
||||||
|
|
||||||
|
# API → Fastify (trailing slash strips /api/ prefix before forwarding)
|
||||||
|
location /api/ {
|
||||||
|
proxy_pass http://172.23.0.3:3050/;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection $connection_upgrade;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Frontend → Vite dev server
|
||||||
|
location / {
|
||||||
|
proxy_pass http://172.23.0.3:5173;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection $connection_upgrade;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -26,8 +26,8 @@ if (process.env.ENABLE_TEST_API === 'true') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await fastify.listen({ port: 3050, host: '127.0.0.1' })
|
await fastify.listen({ port: 3050, host: '0.0.0.0' })
|
||||||
console.log('ASCIInator API → http://127.0.0.1:3050')
|
console.log('ASCIInator API → http://0.0.0.0:3050')
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
fastify.log.error(err)
|
fastify.log.error(err)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
|
|||||||
@ -44,9 +44,7 @@ async function convert() {
|
|||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.name === 'AbortError') {
|
if (err.name === 'AbortError') {
|
||||||
// Intentional cancel (superseded by newer request) — stay silent
|
|
||||||
if (activeController === controller) {
|
if (activeController === controller) {
|
||||||
// Was the 30s timeout, not a cancel
|
|
||||||
emit('conversion-error', 'Conversion timed out (30s)')
|
emit('conversion-error', 'Conversion timed out (30s)')
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -2,13 +2,10 @@ import { fileURLToPath, URL } from 'node:url'
|
|||||||
|
|
||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
import vue from '@vitejs/plugin-vue'
|
import vue from '@vitejs/plugin-vue'
|
||||||
import vueDevTools from 'vite-plugin-vue-devtools'
|
|
||||||
|
|
||||||
// https://vite.dev/config/
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
vueDevTools(),
|
|
||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user