S
S
sadieff2020-02-21 13:26:13
Nginx
sadieff, 2020-02-21 13:26:13

How to set location for 1 domain?

Guys, my task is to transfer the site to VPS.
Now I stumbled on setting up nginx.
I have the following config for the domain:

server {
    listen       00.00.00.00:80;
    server_name  site.ru;
    root /home/admin/web/site.ru/public_html;
    index index.php index.html;
    location / {
        try_files $uri $uri/ =404;
   }

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/site.ru/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/site.ru/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

But my scripts do not run, but php files are returned for download. What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sadieff, 2020-02-21
@sadieff

It seems that I figured it out, I took this from the neighboring config:

location / {
        proxy_pass  http://00.00.00.00:8080;
   }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question