Nginx always responding with default index.html - nginx

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.

Related

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?

VueJs - Blank page when creating a new untouched project

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;
}
}

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;
}
}

Getting 405 when posting to php file

I have an html form which posts to to mysite.com/s/form.php, but when I submit the form I the error 405 Not Allowed. Could this be a permissions issue? Or is it something else? I'm stuck at this point.
This is my current config:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name localhost;
root /var/www/mysite.com/site/;
index index.html index.htm index.php;
location / {
try_files $uri $uri/ =404;
}
location /s/ {
alias /var/www/mysite.com/s/;
}
}
Could someone please point out what's going wrong here?
I forgot to include the bit that makes php work, so nginx thought it was the POST was being sent to a static file, which nginx does not allow.

Resources