A few days ago set up a forum server and put in the company's local area network, the forum is used
9066 Portsand a port forwarding on the router, and
bbs.xxx.com This domain also points to the company's public network IP,
because you want to let users do not enter the port number when accessingSo I want to do a jump on the company's Web server, the request to access bbs.xxx.com to his server. My first idea is to use Nginx
Overview
The Nginx server is now a fairly popular Open-source Web server, and many production environments are using Nginx servers. Now do the project most of the time is using thinkphp, but nginx default does not support thinkphp PathInfo mode, need to make a certain configuration.
Nginx configuration file
# Th
page is not updated frequently, it can be set longer, which can save bandwidth and relieve the pressure of the server expires 1d;} Location =/anon_login.jsp {return 301 https://$server _name$request_uri; } location =/anon_register.jsp {return 301 https://$server _name$request_uri; } location =/anon_forgetpwd.jsp {return 301 https://$server _name$request_uri; } if ($host! = ' www.xxxx.net ') {rewrite "^/(. *) $" http://ww
Objective
Recently applied for an SSL certificate to play, so the blog also enabled HTTPS (on the one hand because the spam comments too much, enable HTTPS should also be able to prevent some simple irrigation machine it?) )。
Then hear a friend to remind, Baidu search engine crawler is not to catch HTTPS, this will bring included problems.
Begin
After some thinking, think through the nginx rules to solv
In order to make the URL more beautiful, we do not want to see the URL of the word php (forced gecko).However, when our PHP project has multiple entry files, (if there are index.php, admin.php, app.php, api.php four entry files), in the non-processing state, the URL will show such a scene:www.example.com/index.php/xxx/xxx/...www.example.com/admin.php/xxx/xxx/...www.example.com/app.php/xxx/xxx/...www.example.com/admin.php/xxx/xxx/...At this point, we can use the
configuration file Location ~. php$ { root html; Fastcgi_pass 127.0.0.1:9000; Fastcgi_index index. php; Fastcgi_param $document _root$fastcgi_script_name# Newinclude # New}3. Hide the entry fileA. If the code is in the root directory that the domain name points to, then// ... omit part of the code if $request _filename ) { rewrite ^ (. *) $ /index.php?s=$1 last ; Break ; }}B. If
This article is for everyone to explain is Ubuntu under the installation nginx error error:the HTTP rewrite module requires the PCRE Library solution, interested students under reference.
This article is for everyone to explain is Ubuntu under the installation nginx error error:the HTTP rewrite module requ
Nginx installation error in ubuntu: the HTTP rewrite module requires the PCRE library solution, nginxpcre
This article describes how to install nginx error: the HTTP rewrite module requires the PCRE library in ubuntu. For more information, see.
This article describes how to install
Overview
In the previous article Nginx configuration thinkphp support URL Rewrite has described how to configure Nginx thinkphp URL Rewrite, but for some special reasons, this is the CentOS platform. The server environment must use Ubuntu, originally thought and cetons in the same, but the configuration finished found
This article mainly describes the Nginx support thinkphp URL Rewrite configuration example, this article directly gives the configuration example, the need for friends can refer to the following
Overview
Nginx server is now a fairly popular open source Web server, many production environments are also using Nginx serv
Original address: Http://www.claudiokuenzler.com/blog/436/nginx-rewrite-url-examples-with-without-redirect-address#.VY9nfJeqqkoNginx can handle the rewrite parameter differently, depending on the destination syntax.Here is some examples how to define redirects and URLs rewrites in Nginx.server {server_name www.example.com;root/var/www/www.example.com;Location/{
file does not existif (!-f $request _filename) {return 400;}
# If host is not xuexb.com, 301 to Xuexb.comif ($host!= "xuexb.com") {Rewrite ^/(. *) $ https://xuexb.com/$1 permanent;}
# returns 405 if the request type is not postif ($request _method = POST) {return 405;}
# If the parameter has a=1 301 to the specified domain nameif ($args ~ a=1) {rewrite ^ http://example.com/permanent;}In some scenarios,
Turn on rewrite logError_log/data/log/nginx/error.log notice;At the outermost, approximately the first few lines of the fileAdd one more line in http{} brackets: Rewrite_log on;The rewritten log will be written to/data/log/nginx/error.logKey codeWrite code in http{server{location {#代码处}}}Location/{if (!-e $request _filename) {
In the use of Nginx configuration rewrite often encountered in places where the last and can not work, replaced by a break, which is the principle of the root directory of the understanding of a difference, according to my test results are roughly the same.
Location/
{
proxy_pass http://test;
alias/home/html/;
root/home/html;
Rewrite "^/
the grammar of a location
Locltion can position requests in different ways to a different approach (the individual feels a bit like the filter in Java)1.1location Classification and usage
Location is broadly divided into three categories:
Location = Patt {} [exact match]
Location patt{} [General match]
Location ~ patt{} [regular match]
Location/{//positioning, personal understanding is the filter in Java.
root html; Match the conditional request forwarding Path
inde
File and directory matching, where:*-F and!-f to determine if a file exists*-D and!-d to determine if a directory exists*-E and!-e to determine if a file or directory exists*-X and!-x to determine if the file is executableExample: Determine whether the access to the picture exists, there is no jump to another domain name Location ~* ^.+. (jpg|jpeg|gif|css|png|js|ico| thumb) { root /data/wwwroot/bbs.xxx.com; Expires 10d; if (-e $request _filename) { ^/data/attach
The nginx pseudo-static setting rules of the following Bo-blog are the code snippets in nginx. conf of the letaotao tomato network, which are recorded here for future use.
server { server_name www.letaotao.net.cn ; rewrite ^(.*) http://letaotao.net.cn$1 permanent;}server { listen 80; server_name letaotao.net
I use lumen to make the API excuse, the URL is static, similar to this:
Https://www.foo.com/api/v1/ar ...
The ID here is the required parameter.
But when I call this interface, the pass-through parameter uses this URL format:
Https://www.foo.com/api/v1/ar ...
Can I change the URL format to support directly in Laravel or lumen? The form of a query?
Or in the Nginx rewrite method
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.