{Listen default;Rewrite ^ (. *) http://www.mydomain.com permanent;}According to the above settings, it is not possible to access the server through the IP, but should be in use when the server_name followed by multiple domain names, one of the domain name can not be accessed, set the following:Copy Codecode example: server {Listen 80;server_name www.example.com example.com} Before the change, through the server_name in the www.example.com example.com can access the server, add
These days to view the CNZZ statistics backstage See, my IP was two unknown domain name binding, in order to avoid being harmonious by the celestial,Can be set on Nginx to prohibit IP access to the server, only through the binding domain name access (at the same time set the unbound domain name return 500 error or jump to my drop domain name home)method is relatively simple,Open nginx.confStep1 Binding website Domain nameAdd a domain name to the serve
First of all, my operating environment is ubuntu14.04+nginx1.4+mysql5.6+php, second, I now have the problem is that my browser access to the Nginx root directory of the PHP project, reported 403forbidden error, but, There is no problem accessing a single PHP file. Ask the Great God to guide you.
Reply content:
First of all, my operating environment is ubuntu14.04+nginx1.4+mysql5.6+php, second, I now have the problem is that my browser access to t
This article mainly introduces the Apache Nginx ban Directory execution php script file method, the content is very good, and now share to everyone, but also for everyone to make a reference.
When we build our website, we may need to set permissions on some directories individually to achieve the security we need. Below is an example of how to disable a directory execution PHP file under Apache or Nginx.
Checked the server_name to make sure the URL is correct. The published directory, determined to exist, and has a permission of 774, has been testing back and forth for a long time, or 403.There is no way to find my eldest brother. He looked for 3 minutes, and told me that the reason is that my directory is nfs4 format, without root has no permissions. It is not my local authorization to be able to ...Nginx.conf the user to root after the reload fix.Do
These days to view the CNZZ statistics backstage See, my IP was two unknown domain name binding, in order to avoid being harmonious by the celestial,Can be set on Nginx to prohibit IP access to the server, only through the binding domain name access (at the same time set the unbound domain name return 500 error or jump to my drop domain name home)method is relatively simple,Open nginx.confStep1 Binding website Domain nameAdd a domain name to the serve
The first day of the configuration of Nginx can be normal access to static pages, the next day through the network cloud disk download index.html file, once again access to the issue of 403forbidden.To view the permissions for a file:[Email protected] 1 hu staff 6351 4 21:10 blueplan.js[email protected] 1 hu staff 113 4 12 21: Ten Blueplan.less[email protected] 1 hu staff 1146 4 21:19 index.htmlFound the file permission followed by an @ symbo
Here are some of the Nginx prohibit SVN directory access to the script, I hope these scripts will help you learn Nginx oh.
Nginx
Location ~. *. (SVN|GIT|CVS) {Deny all;
}
Apache
Rewriteengine on
Rewriterule. svn//404.html
To organize some methods for everyone to refer
Disable access to certain files/directories
Add the Files option to control, such as not all
Label:This article introduces a nginx server anti-SQL injection/overflow attack/spam and Forbidden user-agents Instance code, there is a need to know the friend can enter the reference. Add the following fields to the configuration file
The code is as follows
Copy Code
server {# # Forbidden SQL injection Block SQL injections
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.