Gatsby build doesn't work when hosting on nginx

33
May 15, 2019, at 5:40 PM

I'm trying to host my Gatsby application on a DigitalOcean sever using nginx. I ran the build first using gatsby build and here's the result:

success open and validate gatsby-configs — 0.006 s
success load plugins — 0.315 s
success onPreInit — 0.005 s
success delete html and css files from previous builds — 0.006 s
success initialize cache — 0.010 s
success copy gatsby files — 0.014 s
success onPreBootstrap — 0.007 s
success source and transform nodes — 0.126 s
success building schema — 0.290 s
success createPages — 0.000 s
success createPagesStatefully — 0.060 s
success onPreExtractQueries — 0.003 s
success update schema — 0.028 s
success extract queries from components — 0.214 s
success run static queries — 0.231 s — 5/5 21.81 queries/second
success run page queries — 0.020 s — 7/7 355.50 queries/second
success write out page data — 0.015 s
success write out redirect data — 0.000 s
warning The icon(src/images/logo.png) you provided to 'gatsby-plugin-manifest' is not square.
The icons we generate will be square and for the best results we recommend you provide a square icon.
success Build manifest and related icons — 0.276 s
success onPostBootstrap — 0.279 s
info bootstrap finished - 5.276 s
success Building production JavaScript and CSS bundles — 12.984 s
⠂ Building static HTML for pages{ path: '/*',
  '*': '404',
  uri: '/',
  location: { pathname: '/404/', search: '', hash: '' },
  navigate: [Function: navigate],
  children: undefined,
  pageContext: { isCreatedByStatefulCreatePages: true },
  pathContext: { isCreatedByStatefulCreatePages: true } }
⡀ Building static HTML for pages{ path: '/*',
  '*': '404.html',
  uri: '/',
  location: { pathname: '/404.html', search: '', hash: '' },
  navigate: [Function: navigate],
  children: undefined,
  pageContext: { isCreatedByStatefulCreatePages: true },
  pathContext: { isCreatedByStatefulCreatePages: true } }
success Building static HTML for pages — 5.700 s — 7/7 11.42 pages/second
info Done building in 23.964 sec

After copying the build result from public folder to my nginx folder var/www/academy and test it out, nothing shows up and none of the JS is displayed.

Here's my nginx config:

# Academy landing page
server {
        listen 443 ssl;
        listen [::]:443 ssl;
        server_name ***************;
        server_tokens off;
        access_log /var/log/academy/access.log;
        error_log /var/log/academy/error.log;
        # LetsEncrypt Certification
        ssl_certificate ***********
        ssl_certificate_key ***********
        # SSL Configuration
        include snippets/ssl-params.conf;
        root /var/www/academy;
        index index.html;
}
READ ALSO
KMS encrypt file data using Boto3

KMS encrypt file data using Boto3

I am using the below code to KMS encrypt the data in a fileIs there a way to do something similar using boto3 in python?

45
How to Communicate between Activity and Service using LocalBroadcastManager in a different Process

How to Communicate between Activity and Service using LocalBroadcastManager in a different Process

I have a Service which is in a different process defined in Manifest and a MapboxMap Activity, and I just wanted to know how I can communicate between my Service and Activity using LocalBroadcastManager

32
spring security work only for highest priority order

spring security work only for highest priority order

I am trying to integrate spring mvc in existing spring rest projectSecurity for spring rest is working fine

32
Expressing Java Annotation Class with Members in Kotlin

Expressing Java Annotation Class with Members in Kotlin

I'm new to Kotlin and currently using v13

28