Nuxt js return cors problem in subdomain

This code working on local but live not work Nginx

server {
    listen 80;
    listen [::]:80;
    index index.html;

    location / {
        proxy_pass http://localhost:3000;
        proxy_set_header Access-Control-Allow-Origin *;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;


axios: {
    prefix: '/api',
  proxy: {
    '/api': {
      target: '',
      pathRewrite: {
        '^/api': '/'

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer