After searching and testing on the Internet, it is found that the rewrite rules of Nginx and the Rewite rules of Apache are not very different, and can be used almost directly. Like writing rules like this in Apache.
Rewrite ^/([0-9]{5}). html$/viewthread.php?tid=$1 last;
Writing in Nginx is impossible to
becomes the new URL when the redirect is requested.
Data sharing
When a request is forwarded, the forwarded page and the forwarded page can share the data in the request, and the data cannot be shared when the redirect is requested.
Application scope
Request forwarding is typically used when a user logs on, and is forwarded to the appropriate place according to the role.
Request redirection is typical
queuesWorker_connections 1024;}http{#日志格式定义Log_format Main ' $remote _addr-$remote _user [$time _local] "$request" '' $status $body _bytes_sent ' $http _refer '' "$http _user_agent" "$http _x_forward_for";#Linux内存 operating system and drivers run at the kernel level, applications run at the user levelSendfile on;Keepalive_timeout 65;#启用压缩功能gzip on;#反向代理缓存目录Proxy_cache_path/data/proxy/cache levels=1:2 keys_zone=cache_one:500m inactive=1d max_size=1g;#负载均衡Upstream My_server_pool {Server 192.168.1
;
Proxy_busy_buffers_size 64k;
Proxy_temp_file_write_size 64k;
}
The rewrite configuration here mainly describes the following points:
Rewrite usage: Rewrite regular replacement flag bit
The first row configuration and the second row configuration order cannot be reversed, because the ngin
code is as follows: server {server_name www.jefflei.com jefflei.com;if ($host! = ' www.jefflei.com ') {Rewrite ^/(. *) $ http://www.jefflei.com/$1 permanent;}...}The second method:Copy CodeThe code is as follows: server {server_name jefflei.com;Rewrite ^/(. *) http://www.jefflei.com/$1 permanent;}Test the first method OK, in both methods, permanent is the key, detailed description of the
://blog.csdn.net/wave_1102/article/details/46483897Iii. Comparison of Apache and NginxThe URL rewrite logic for the same effect that the two servers implement is a comparison chart:Same point:Use common regular syntax for URL matching.Different points:NGINGX cannot be used and the statement. You need to use a SET statement to handle it.The corresponding tags and
URL rewrite of Cento7+nginxOur previous article wrote a Cento7+nginx reverse proxy implementation of multi-domain jump, today mainly introduce the Cento7+nginx URL rewrite,Hostname:a-s.ixmsoft.comip:192.168.5.20Role:nginx ServerWe
thinkphp nginx php-fpm url rewrite causes 404 error, Thinkphpnginx
thinkphp nginx php-fpm url rewrite cause 404 error
The previous thinkphp system was deployed on Apache, considering that the concurrency performance of
The equals type (=) has the highest precedence. Once the match succeeds, no other matches are found.
An ^~ type expression. Once the match succeeds, no other matches are found.
The priority of the regular expression type (~ ~*). If more than one location has a regular match, the longest regular expression will be used.
The regular string match type. Match by prefix.
Example-Fake address mask true addressserver { # 用 xxoo_admin 来掩饰 admin location / { # 使用br
here's how to make Nginx support thinkphp pathinfo and URL rewrite mode. 1, Thinkphp gives the official solution of thinkphp, as follows:Open Nginx configuration file/etc/nginx/nginx.cof is generally in this path, depending on your installation path may vary. If you configur
thinkphp nginx php-fpm url rewrite cause 404 error
The previous thinkphp system was deployed on Apache, considering that the concurrency performance of Nginx was much more powerful than Apache, so the thinkphp system was redeployed in NGINX+PHP-FPM mode on CentOS, and the r
thinkphp nginx php-fpm url rewrite cause 404 error
thinkphp nginx php-fpm url rewrite cause 404 error
The previous thinkphp system was deployed on Apache, considering that the concurrency performance of
thinkphp How to Implement "http://localhost/index.php?/module/Operation quo ... Change to "http://localhost/module/operation"
I want to change the URL into this form, it will look comfortable, but I do not know how to achieve.
Is the CONIFG inside add parameter, or in Nginx inside with rewrite?
Reply content:
thinkphp How to Implement "http://localhost/index
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/...w
This article mainly introduces about ThinkPHP5.0 Linux Apache/nginx rewrite URL configuration, has a certain reference value, now share to everyone, the need for friends can refer to
Author system is ubuntu,centos and other Linux distributions please change your ownPHP Framework is ThinkPHP5.0, the official document is somewhat vague, so I added a bit
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.
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
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 u
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
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.