I am very new to nginx. I was using Apache previously and was using htaccess to redirect root to another folder. Now migrated to nginx. Here is four things I want to achieve
- Redirect http to https e.g. http://www.example.com -> https://www.example.com
- Then redirect root to another folder but URL must be rewritten as example.com not example.com/blog
- All files in php should show as html in url e.g. example.com/contact.php -> example.com/contact.html
example.com/page.php?content=file -> example.com/file I found this code to redirect but don't know where to insert this code nginx.conf or any other file?
server{
location = / { return 301 https://www.example.com/blog; }}
Also please suggest me if these changes are made in nginx.conf file or /etc/nginx/sites-available/example.com file.