Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Nginx and Nodejs app on RPi2 - Routing issues

$
0
0
I originally configured the nodejs app on the rpi2 behind a linksys router and the app responded fine from an outside server.

Then I installed nginx and added https with a certificate from letsencrypt and it served the https site just fine to my Mac on the same network.

Now that I'm trying to combine the two, but it's not working, I get a 404 not found. My app is at:

/www/subdomain.domain.com/aism/app.js

The nginx config for that /etc/nginx/sites-available/subdomain.domain.com is as follows:

[code]
server {
listen 80;
listen [::]:80;
server_name subdomain.domain.com;
return 301 https://$server_name$request_uri;
}

server {
listen 443 ssl;
listen [::]:443 ssl;
server_name subdomain.domain.com;

ssl_certificate /etc/letsencrypt/live/subdomain.domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/subdomain.domain.com/privkey.pem;

root /www/subdomain.domain.com;
index index.php index.html index.htm;

error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /www/subdomain.domain.com;
}

# Error & Access logs
error_log /www/subdomain.domain.com/logs/error.log error;
access_log /www/subdomain.domain.com/logs/access.log;

location / {
index index.html index.php;
proxy_pass http://LocalLanIp:442;
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;
}

location ~ /.well-known {
allow all;
}

location ~ [^/].php(/|$) {
fastcgi_split_path_info ^(.+?.php)(/.*)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
[/code]

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>