Welcome! Log In Create A New Profile

Advanced

Re: nginx redirects all requests to root

June 20, 2022 08:58PM
On Mon, 20 Jun 2022 17:23:23 -0400
"_lukman_" <nginx-forum@forum.nginx.org> wrote:

> server
> {
> listen 443 default_server ssl;
> listen [::]:443 ssl http2;
> server_name dummysite.io www.dummysite.io;
> ssl_certificate /etc/letsencrypt/live/dummysite.io/fullchain.pem; #
> managed by Certbot
> ssl_certificate_key
> /etc/letsencrypt/live/dummysite.io/privkey.pem; # managed by Certbot
> location /
> {
> root
> /home/ubuntu/dummysite-ui/_work/dummysiteWebV1/dummysiteWebV1/build/web/;
> index index.html index.php;
> # try_files $uri /index.html index.php;
> }

The mail wrapping makes this kind of confusing. From my own conf file
the root line is not within location. I believe this is what you want:

server
{
listen 443 default_server ssl;
listen [::]:443 ssl http2;
server_name dummysite.io www.dummysite.io;
ssl_certificate /etc/letsencrypt/live/dummysite.io/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/dummysite.io/privkey.pem; # managed by Certbot
root /home/ubuntu/dummysite-ui/_work/dummysiteWebV1/dummysiteWebV1/build/web/;
location /
{
index index.html index.php;
# try_files $uri /index.html index.php;
}

I put my webroot in /usr/share/nginx/html/website1

I have this line after the server_name:
ssl_dhparam /etc/ssl/certs/dhparam.pem;

Hopefully this works. If not wait for the gurus.






_______________________________________________
nginx mailing list -- nginx@nginx.org
To unsubscribe send an email to nginx-leave@nginx.org
Subject Author Posted

nginx redirects all requests to root

_lukman_ June 20, 2022 05:23PM

Re: nginx redirects all requests to root

gariac June 20, 2022 08:58PM

Re: nginx redirects all requests to root

_lukman_ June 21, 2022 03:59AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 55
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready