Я работает Сервер Apache на порте 88 и Nuxt.js Dev Server на порте 3000 . Я настроил Apache на прокси -запросы на Nuxt, но я продолжаю получать следующую ошибку в консоли браузера: < /p>
Код: Выделить всё
GET http://mycomputername:88/app/ net::ERR_ABORTED 404 (Not Found)
конфигурация Apache
ServerAdmin postmaster@localhostServerName mycomputername:88
# DocumentRoot and directory settings
DocumentRoot "C:/Alati/Apache24/htdocs"
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
Alias /C/ "C:/"
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
Alias /E/ "E:/"
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
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
< /code>
nuxt.js configuration < /h4>
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,
});
< /code>
Сводка настройки < /h4>
И Apache, и Nuxt.js работают на одной и той же машине.
Сервер Apache настроен для прослушивания на порту 88.
Nuxt.js Dev Dev работает на порте 3000.
Директива Proxypass в Apache настроена на прокси -запросы на http: // mycomputername: 3000 /app. /> Несмотря на то, что я настроил прокси -тип для/приложения, я все еще получаю ошибку 404, не найдена при попытке получить доступ к http: // mycomputername: 88/app/.
Что могло причинить эту проблему? Как я могу правильно настроить Apache на прокси -запросы на nuxt.js?
Подробнее здесь: https://stackoverflow.com/questions/793 ... pache-nuxt
Мобильная версия