Reputation: 1
I am running an Apache server on port 88
and a Nuxt.js dev server on port 3000
. I have configured Apache to proxy requests to Nuxt, but I keep getting the following error in the browser console:
GET http://mycomputername:88/app/ net::ERR_ABORTED 404 (Not Found)
<VirtualHost *:88>
ServerAdmin postmaster@localhost
ServerName mycomputername:88
# DocumentRoot and directory settings
DocumentRoot "C:/Alati/Apache24/htdocs"
<Directory "C:/Alati/Apache24/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
Alias /C/ "C:/"
<Directory "C:/">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Alias /E/ "E:/"
<Directory "E:/">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/(C|E|app|ws)(/.*)?$
RewriteRule ^(.*)$ /app [L,R=301]
ProxyPass /app http://mycomputername:3000/app
ProxyPassReverse /app http://mycomputername:3000/app
</VirtualHost>
export default defineNuxtConfig({
modules: ['@nuxt/eslint', '@pinia/nuxt'],
ssr: false,
devtools: { enabled: false },
app: {
baseURL: '/app/',
head: {
htmlAttrs: { lang: 'hr' },
title: 'Proba',
},
errorPage: { page: '/error.vue' },
},
css: [
'vuetify/lib/styles/main.sass',
'@mdi/font/css/materialdesignicons.min.css',
],
build: {
transpile: ['vuetify'],
terserOptions: { keepNames: true },
},
devServer: {
host: 'mycomputername',
port: 3000,
cors: { origin: ['http://mycomputername/'] },
},
compatibilityDate: '2025-01-01',
vite: {
esbuild: { keepNames: true },
server: {
allowedHosts: ['mycomputername'],
hmr: { overlay: false, protocol: 'ws', port: 3000, clientPort: 3000 },
},
},
telemetry: false,
server: false,
});
Both Apache and Nuxt.js are running on the same machine. The Apache server is configured to listen on port 88. The Nuxt.js dev server is running on port 3000. The ProxyPass directive in Apache is configured to proxy requests to http://mycomputername:3000/app. Issue Even though I have set up ProxyPass for /app, I am still getting a 404 Not Found error when trying to access http://mycomputername:88/app/.
What could be causing this issue? How can I correctly configure Apache to proxy requests to Nuxt.js?
Upvotes: 0
Views: 58