react-slingshot: serving dist directory through nginx fails
I’ve been trying to deploy my app the past couple of days using nginx. It definitely works when using express and pointing the dist folder, using: app.use(express.static('dist'));
The problem is when serving it through nginx using a location block. I have the following location block
location /myblog {
alias /app/blog/dist;
index index.html index.htm;
}
It hits the route, loads the index.html, .js & .css, but it renders an empty app. Any thoughts??
<body style="background:#fff;font-family:Helvetica"><div id="app">
<!-- react-empty: 1 --></div>
<script type="text/javascript" src="/main.746946c56bcce138a405.js"></script>
</body>
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 17 (6 by maintainers)
I’ve confirmed it works just fine when served from web root. (which is as designed)
Steps to reproduce:
Step 4 will open a lightweight http server that serves files from dist. The app works fine for me. So this proves it works fine with a plain webserver that simply serves static files.