VueJs - Blank page when creating a new untouched project - nginx

I've installed a version of VueJS on a Digitalocean server but all I keep seeing is a blank page. This is just a plain, stock project created using the Vue CLI.
Have no idea what the issue can be.
Here's what I have in my sites-available for Nginx. It's the only thing I've changed. Everything else for this Vue project is completely stock.
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/midtest/public;
index index.html index.htm index.nginx-debian.html;
server_name _;
error_page 404 /index.html;
location / {
try_files $uri $uri/ /index.html;
}
}

Related

Nginx always responding with default index.html

I am so new for deploying things.I am just trying to deploy 2 different websites with nginx. I checked a few documents and videos but my second website which knowinapp is not working as well. Whenever I am checking the website it is showing default index.html or the other my website's index.html I don't know what I am missing.
default.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
try_files $uri $uri/ =404;
}
}
knowinapp.conf file
server {
listen 80;
listen [::]:80;
server_name knowinapp.com www.knowinapp.com;
root /var/www/knowinapp.com;
index index.html;
location / {
try_files $uri $uri/ =404;
}
}
The problem was about browser cache things. So, I was checked on different browser and saw the website works well... Or you can delete the cookie and site data.

My self hosted website won't load on devices that are not connected to my network

I'm hosting my website on a raspberry pi using nginx, and i have opened port 80 on my router. But it still does not work outside of my network.
here is how i have configured my "default" file
server {
listen 80;
listen [::]:80;
server_name wylie.club;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
location / {
try_files $uri $uri/ =404;
}
}
let me know if you need more resources from me, and thank you for helping out!

Nginx SSL get blank page

I'm trying for hours to put SSL to work on nginx without success. I have already setup all things correct but i'm getting blank page when i trying to access in https. website on http work fine.
I got certificate and key from cloudflare (i already setup with it some time ago and i remember this part).
I have setup the certificate and key on /etc/nginx/ssl and my configuration of server looks like:
server {
listen 443 default default_server;
listen [::]:443 ssl default_server;
server_name myhost.com;
ssl_certificate /etc/nginx/ssl/certificate.pem;
ssl_certificate_key /etc/nginx/ssl/key.pem;
root /var/www;
index index.php index.html index.htm index.nginx-debian.html;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
}
}
I got blank page when access on https, and i don't get any erros and logs on erros/access.logs from nginx..
could someone help me?

Nginx Custom error page for Individual directory

This my nginx configuration for 404 custom error page. But my problem is I'm getting custom 404 error page for all my 404 error that occurs in my server. I want to get custom error page for a particular directory only.
server {
listen 80 default_server;
listen [::]:80 default_server;
index index.html index.htm index.nginx-debian.html;
server_name localhost;
location / {
root /var/www/html;
try_files $uri $uri/ =404;
}
error_page 404 /fail.html;
location = /fail.html {
root /var/www/html/checking/errors;
internal;
}
location /testing/([a-zA-Z]+)/ {
root /var/www/html/testing/$1;
try_files $uri $uri.html;
}
}
Assuming that what you're asking for is that when people attempt to view files of the form /testing/does-not-exist then they will see you error file, you want to move the error_page 404 /fail.html to within that location block. Where you have it right now (within the server block), it will apply to all requests. If it's for a different path that you'd like the error to show up, create a new location block for that path and then add the error_page directive to that block.

NGINX alias with HHVM

I'm trying to reroute one of my web directories to another project directory in the home folder. But when I try and access the page, I get served a blank file
I believe the fault in on the try_files $uri $uri/ /rtstaging/index.php?$query_string; line. But I'm new to using nginx, so any help would be much appreciated
server {
listen 80;
listen [::]:80;
root /home/default/public;
index index.php index.html index.htm;
server_name nu-voo.co.uk www.nu-voo.co.uk;
include hhvm.conf;
location /rtstaging/ {
alias /home/rtsearch/public/;
try_files $uri $uri/ /rtstaging/index.php?$query_string;
include hhvm.conf;
}
}

Resources