Discover nginx server name localhost, include the articles, news, trends, analysis and practical advice about nginx server name localhost on alibabacloud.com
;;*)echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"exit 2esac
Set the constants pidfile, nginx, NGINX_CONF_FILE, and lockfile according to the actual path.
Run the following command:
# chmod 755 /etc/init.d/nginx# chkconfig --add nginx# chkconfig nginx on# mkdir -p /
with your default configuration, it is placed under/usr/local/nginx, and the following is the directory structure:/usr/local/nginx/conf Configuration Directory/usr/local/nginx/html the default Web site root directory/usr/local/nginx/logs log and PID files directory/usr/local/nginx
Under the macro control of the country, if a website accidentally leaves the country, it is helpless. In a Harmonious Society, everyone should do their best. Windows hosts outside China are expensive. Linux is much cheaper than Windows because the system is free of charge. Although I have never used Linux before, I still bought a Linux VPS (I can't afford it on an independent server, and it's not necessary). So I learned how to install the Lnmp one-ke
Like/bbs/301 jump to the new level two domain
With the LNMP, I was directly adding a bbs.conf file to the/usr/local/nginx/conf
Then add an include bbs2.conf in 111cn.net's conf configuration;
Reboot complete.
The contents of the bbs.conf are:
The code is as follows
Copy Code
Location ~* ^/bbs/{Rewrite ^/bbs/(. *) $ http://your level two domain name/$1 permanent;}
D
about the method. I will not talk about the specific Lnmp installation, and I will not be refined. 301 redirection is mainly used to modify the core variable of nginx and the server function of the conf file of the target website.
For example, to redirect 2cto.com to www.2cto.com, modify the code as follows:
Server {Server_name www.2cto.com 2cto.com;If ($ host!
Redirect to: The original URL in the domain name + directory name +/Server_name_in_redirect off;
Server_tokens off;
# Sub Filter # include sub_filter.conf; # Null hostname server {listen default;
return 444;
Access_log off;
} server {Listen 5566;
server_name
index.php; Fastcgi_param script_filename $document _root$fastcgi_script_name; Include Fastcgi_params; } } }
I'm already in C:\Windows\System32\drivers\etc\hosts.
127.0.0.1 www.test.com
With 127.0.0.1:81 can be accessed using www.test.com directly is "Unable to display this page"
Reply to discussion (solution)
Big Brother, you have to add a port number, okay!www.test.com:81If you don't serve something the slogan, change 81 to 80.
The default is 80 port, you cha
This article introduces how to install the latest nginx and socks5 Proxy server dante-server method in CentOS.
Generally, we can use yum install nginx in CentOS to install nginx. However, the nginx installed is not the latest. How
/nginx/clientStep 3: Start the Nginx service and test on the client#/usr/local/nginx/sbin/nginxEnter the native IP on the browserProject 2: Implementing a Virtual HostStep 1: Preparing for work# ifconfig eth0:0 192.168.111.20Create Two site directories# mkdir/website1# Mkdir/website2Set up two directories to store logs# mkdir/var/log/
/nginx/conf. d/default. conf
Change server_name:
Server_name localhost;
Change the first default localtion:
location / { try_files $uri $uri=404;}
Change 404:
error_page 404 /404.html;
Run the following command:
Vim/etc/php-fpm.d/www. conf
Find and remember the listen content (the following 127.0.0.1: 9000 is my local settings ):
Listen = 127.0.0.1: 9000
Change the PHP configurat
Centos + nginx configure server load balancer from scratch, centosng.pdf. Centos + nginx configure server load balancer from scratch. centosnginxnginx server load balancer understands that nginx is a lightweight and high-performan
1. Generate Password using HTPASSWDUse Apache to generate/usr/local/apache2/bin/htpasswd-c./htpasswd.users nagiosadminCopy to Nginx server, CP htpasswd.users/usr/local/nagios/etc/2,/usr/local/nagios/etc/cgi.cfg in the configurationauthorized_for_system_information=nagiosadminauthorized_for_configuration_information= Nagiosadminauthorized_for_system_commands=nagiosadminauthorized_for_all_services= Nagiosad
Based on the company's needs and future visits, nginx is used as the Server Load balancer server and cache Server. The backend uses two tomcat servers to provide web services, and user information data is stored in oracle, audio files are stored on a separate application server
the required modules are installed.Compile the Nginx with the HelloWorld module:
./configure--prefix=/usr/local/nginx--add-module=/opt/nginx_hello_world/make make
install
E, configure nginx.conf
location=/hello {
hello_world;
}
F, start Nginx, Access Http://localhost/hello, you can se
be longer. If you look closely at the process of the terminal. You will find how smart you are to install with homebrew. In fact, before installing Nginx also to help you install a lot of other, if you install independently, is very laborious ...3. Start NginxStill in the terminal, enterJust enter the line. Don't be surprised, it's so simple.How to verify that the nginx can be used. You entered in the brow
anginx.conf.defaultDocument, remember, do not look wrong, the name is very similar. Open with a text editor, there is content in the default, you can see. Paste the following in.
server {
Listen 8080;
server_name localhost;
#access_log Logs/host.access.log Main;
Location ~* {
Add_header content-type "Application/json";
root HTML;
Nginx is a high-performance HTTP and reverse proxy server and a IMAP/POP3/SMTP proxy server. The concurrency capabilities of Nginx do perform well in the same type of Web server. Nginx is available in some Linux distributions and
: You can change the red font based on your actual situation;
4. Start Nginx
4.1 verify that nginx configuration is normal
#/Usr/local/nginx/sbin/nginx-t
Note: The following content is returned, otherwise it will be changed as prompted;
Nginx: the configuration file/usr/l
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.