U
U
Unfex2017-07-14 19:52:25
Nginx
Unfex, 2017-07-14 19:52:25

nginx | How to give another file?

The client connects to example.com/text/first.php
Without redirects, the contents of the file from /home/123.txt are given
How to do this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry MiksIr, 2017-07-14
@Unfex

location = /text/first.php {
alias /path/home/123.txt;
}
/path/ - physical path on the server

R
RidgeA, 2017-07-14
@RidgeA

location /text/first.php {
                root /var/www/html;
                index 123.txt;
        }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question