Gathering detailed insights and metrics for @nuxtjs/proxy
Gathering detailed insights and metrics for @nuxtjs/proxy
Gathering detailed insights and metrics for @nuxtjs/proxy
Gathering detailed insights and metrics for @nuxtjs/proxy
@nuxt-alt/proxy
An alternative module to @nuxtjs/proxy
@nuxtjs/axios
Secure and easy Axios integration with Nuxt.js
@nuxt/opencollective
[![npm version][npm-v-src]][npm-v-href] [![npm downloads][npm-d-src]][npm-d-href] [![status][github-actions-src]][github-actions-href]
@nuxtjs/eslint-module
ESLint module for Nuxt
The one-liner node.js http-proxy middleware solution for Nuxt 2 using http-proxy-middleware
npm install @nuxtjs/proxy
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
413 Stars
76 Commits
26 Forks
7 Watching
11 Branches
33 Contributors
Updated on 16 Nov 2024
TypeScript (77.01%)
JavaScript (20.35%)
Vue (2.64%)
Cumulative downloads
Total Downloads
Last day
-2.3%
31,581
Compared to previous day
Last week
2.8%
160,386
Compared to previous week
Last month
2.1%
686,928
Compared to previous month
Last year
-27%
9,692,261
Compared to previous year
Proxy support for Nuxt 2 server
In Nuxt 3 you can make use of Route Rules to configure your proxies.
1export default defineNuxtConfig({
2 routeRules: {
3 '/proxy/example': { proxy: 'https://example.com' },
4 '/proxy/**': { proxy: '/api/**' },
5 }
6})
✓ Path rewrites
✓ Host based router (useful for staging/test)
✓ Logs / Proxy Events
✓ WebSockets
✓ Auth / Cookie
✓ ...See http-proxy-middleware docs
âš Does not work with nuxt generate
(see static target).
@nuxtjs/proxy
dependency to your project1yarn add @nuxtjs/proxy # or npm install @nuxtjs/proxy
@nuxtjs/proxy
to the modules
section of nuxt.config.js
1{ 2 modules: [ 3 // Simple usage 4 '@nuxtjs/proxy' 5 ], 6 proxy: { 7 // see Proxy section 8 } 9}
proxy
section of nuxt.config.js
(See proxy section below)proxy
You can provide proxy config using either object or array.
You can use shorthand syntax to configure proxy:
1{ 2 proxy: [ 3 // Proxies /foo to http://example.com/foo 4 'http://example.com/foo', 5 6 // Proxies /api/books/*/**.json to http://example.com:8000 7 'http://example.com:8000/api/books/*/**.json', 8 9 // You can also pass more options 10 [ 'http://example.com/foo', { ws: false } ] 11 ] 12}
Keys are context
1{ 2 proxy: { 3 // Simple proxy 4 '/api': 'http://example.com', 5 6 // With options 7 '/api2': { 8 target: 'http://example.com', 9 ws: false 10 }, 11 12 // Proxy to backend unix socket 13 '/api3': { 14 changeOrigin: false, 15 target: { socketPath: '/var/run/http-sockets/backend.sock' } 16 } 17 } 18}
changeOrigin
and ws
options are enabled by default.You can provide default options to all proxy targets by passing options to module options:
1export default { 2 modules: [ 3 // Disable ws option to all proxified endpoints 4 ['@nuxtjs/proxy', { ws: false }] 5 ], 6 proxy: [ 7 'http://example.com/foo', 8 'http://example.com:8000/api/books/*/**.json', 9 ] 10}
This will be similar to:
1export default { 2 modules: [ 3 '@nuxtjs/proxy', 4 ], 5 proxy: [ 6 ['http://example.com/foo', { ws: false }], 7 ['http://example.com:8000/api/books/*/**.json', { ws: false }] 8 ] 9}
yarn install
or npm install
npm run dev
Copyright (c) Nuxt Community
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
Found 4/22 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
88 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More