voidlabs / mosaico

Mosaico - Responsive Email Template Editor
https://mosaico.io
GNU General Public License v3.0
1.69k stars 500 forks source link

How to configure mosaico in Server version: Apache/2.4.41 (Ubuntu 20.04) or nginx version: nginx/1.18.0 (Ubuntu 20.04) #597

Closed noor1726 closed 3 years ago

noor1726 commented 3 years ago

Hi I'm new on server configuration, here I planing to use mail editor in my project, so did clone from mosaico master and install npm and other dependency but storefront not loading images and other paths like templates properly. here I shared some screen for both Apache and nginx related please help me for 100% working do i need setup or configure in server /app level setup?
Note: I download and run in localhost it working fine, but I'm facing issue on sever (server setup in Google Cloud instances)

image

Node : v10.19.0 npm : 6.14.4 shared grunt run log. ubuntu@mail-editor:/var/www/mosaico$ grunt Running "googlefonts:noto" (googlefonts) task

1 font downloaded.

Running "copy:res" (copy) task Created 6 directories, copied 41 files

Running "copy:root" (copy) task Copied 1 file

Running "copy:htmls" (copy) task Copied 2 files

Running "copy:fontawesome" (copy) task Copied 5 files

Running "uglify:deps" (uglify) task

1 sourcemap created. 1 file created 2.44 MB → 947.88 kB

Running "cssmin:deps" (cssmin) task

1 file created. 358 B → 322 B

Running "jshint:all" (jshint) task

✔ No problems

Running "combineKOTemplates:main" (combineKOTemplates) task

Running "browserify:main" (browserify) task

1379923 bytes written (0.52 seconds) Bundle build/mosaico.inlinesourcemap.js created.

Running "exorcise:main" (exorcise) task Exorcising source map from build/mosaico.inlinesourcemap.js

Running "uglify:min" (uglify) task

1 sourcemap created. 1 file created 542.71 kB → 231.75 kB

Running "less:css" (less) task

2 stylesheets created.

Running "postcss:dist" (postcss) task

1 processed stylesheet created. 1 sourcemap created.

Running "postcss:material" (postcss) task

1 processed stylesheet created. 1 sourcemap created.

Running "express:dev" (express) task Starting foreground Express server 9006

Storefront console log error image

Apache config file image

image

Nginx setup : Storefront Editor image

Nginx config file screen image

noor1726 commented 3 years ago

after adding bellow code in nginx site config file, it's loading fine. Thanks, server { listen 80; server_name mydomain.com; location / { proxy_pass http://localhost:9006; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection keep-alive; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } }

image