nginx root alias difference
访问的目录结构
<code>root@nginx02 ~ <span># tree /application/image/</span> /application/image/ |<span>-- 01.jpg</span> |<span>-- images</span> | |<span>-- 01.jpg</span> | |<span>-- i1</span> | | `<span>-- 01.jpg</span> | |<span>-- i2</span> | | `<span>-- 02.jpg</span> | |<span>-- i3</span> | | `<span>-- 03.jpg</span> | |<span>-- i4</span> | | `<span>-- 04.jpg</span> | |<span>-- i5</span> | | `<span>-- 05.jpg</span> | |<span>-- i6</span> | | `<span>-- 06.jpg</span> | `<span>-- i7</span> | `<span>-- 07.jpg</span> `<span>-- imgs</span> `<span>-- 01.jpg</span><span>9</span><span>directories</span>, <span>10</span><span>files</span></code>
栗子说明
<code><span>1</span>,如果请求路径是完全匹配^<span>$正</span>则 <span>alias</span> 必须是完整的路径匹配 不然会找不到文件 http:<span>//www.static.com/images/i1/01.jpg</span> location ~ <span>"^/images/i([0-9]{1})/(.*\.(gif|jpg|png|js|css))$"</span> { <span>alias</span> /application/<span>image</span>/images/i<span>$1</span>/<span>$2</span>; } <span>2</span>,如果请求路径是目录请求 <span>alias</span> 路径别名最后/必须加上 http:<span>//www.static.com/test/01.jpg</span> http:<span>//www.static.com/test/i1/01.jpg</span> location /test/ { <span>alias</span> /application/<span>image</span>/images/; } <span>3</span>,如果请求路径是/test/<span>01.</span>jpg 返回的路径<span>alias</span> /application/<span>image</span>/images/<span>01.</span>jpg <span>4</span>,如果请求路径是/test/i1/<span>01.</span>jpg 返回的路径<span>alias</span> /application/<span>image</span>/images/i1/<span>01.</span>jpg 注意----------- <span>alias</span> 会自动把请求/test/i1/<span>01.</span>jpg i1自动拼接到 <span>alias</span> /application/<span>image</span>/images/i1/后面 在去查找文件 /i1/<span>01.</span>jpg 如果请求www.test/il/<span>01.</span>jpg root 会把i1拼接到 root /application/<span>image</span>/images/il/ 到i1目录找<span>01.</span>jpg 若果是请求/i1/i01/<span>01.</span>jpg 会把i1/i01拼接到 root /application/<span>image</span>/images/il/i01/ 到i1/i01目录找<span>01.</span>jpg root 路径最后面可以没有/; location /i1/ { root /application/<span>image</span>/images; } 总结 <span>1</span>,root 使用 /i1/ 是拿i1/后面去拼接 ,root 路径后面可以没有反斜杠/ <span>2</span>,<span>alias</span> /test/i1/ 是从/test/后面拿去拼接,就是二级目录去拼接 访问目录必须带反斜杠 ,如果完全资源匹配就不用加上反斜杠/; </code>
以上就介绍了 nginx root alias 区别,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



How to Convert PNG to JPG on Windows 11 On Windows 10 and 11, you can use Microsoft's built-in Paint app to quickly convert image files. To convert a PNG image to JPG on Windows 11, use the following steps: Open File Explorer and navigate to the PNG image you want to convert. Right-click the image and select Open With > Draw from the menu. Your photo or image opens in the Paint app. Note the file size at the bottom of the screen. To convert a file from PNG to JPG, click File and select Save As > JPEG Image from the menu. When the file resource

JPG is one of the most popular image file formats along with PNG. This is a lossy compressed image format ideal for websites. Therefore, many users save or convert images to JPG format. However, some users have stated that they are having issues opening JPG files in Windows 11 using the platform’s default Photos app. Therefore, these users cannot open, view and edit JPG format images in Windows 11. This is what one user said in a Microsoft forum post: When double-clicking a JPG file to open in Microsoft Photo, I receive the error The specified program cannot be found. This was purchased new about a month ago

In recent years, with the continuous development of Web technology, WebP, a new image format, has gradually entered the field of vision of programmers and Web developers. The advantages of WebP cannot be ignored: small file size, high quality, high browser support, etc. But in some cases, we may need to convert WebP images into some other formats, such as JPG. So, how to use PHP to convert WebP to JPG?

The python environment this article relies on is: What is WSGI? WSGI is also called the web server universal gateway interface, and its full name is webservergatewayinterface. It defines a standard for how web servers and web applications should communicate and handle http requests and responses in Python. Note that it is just a protocol, or a specification or standard. You don’t have to follow this standard. Just like the web server we wrote in the previous article. WSGI is also divided into applications and server gateways. Among them, the well-known Flask belongs to applications, and uWSGI and wsgiref belong to server gateways. Personal feeling, WSG

JPG is a JPEG format file. The JPEG format is the most commonly used image file format, with the suffix ".jpg" or ".jpeg". JPG format standards are divided into three types: JPEG, progressive JPEG, and JPEG2000. It is a standard generally used for continuous-tone static image compression. It is lossy compression, which compresses data images in a small storage space while causing loss of image data. Damage, if the user has higher requirements for image quality, it is recommended to abandon this image file format, especially for some high-definition pictures.

JPG generally refers to the JPEG format, which is an image format saved using a lossy compression method. It is a standard for continuous tone static image compression. Its file suffix is ".jpg" or ".jpeg". JPG files mainly use a joint coding method of predictive coding (DPCM), discrete cosine transform (DCT) and entropy coding to remove redundant images and color data; it can compress images in a small storage space, but to a certain extent will cause damage to the image data.

How to delete images on Xiaomi mobile phones? You can delete images on Xiaomi mobile phones, but most users don’t know how to delete images. Next is the tutorial on how to delete images on Xiaomi mobile phones brought by the editor. Interested users can come and join us. Let's see! How to delete images on Xiaomi mobile phone 1. First open the [Album] function in Xiaomi mobile phone; 2. Then check the unnecessary pictures and click the [Delete] button in the lower right corner; 3. Then click [Album] at the top to enter the special area , select [Recycle Bin]; 4. Then directly click [Empty Recycle Bin] as shown in the figure below; 5. Finally, directly click [Permanent Delete] to complete.

This article will introduce seven ways to get high-quality output using the free BingImageCreator. BingImageCreator (now known as ImageCreator for Microsoft Designer) is one of the great online artificial intelligence art generators. It generates highly realistic visual effects based on user prompts. The more specific, clear, and creative your prompts are, the better the results will be. BingImageCreator has made significant progress in creating high-quality images. It now uses Dall-E3 training mode, showing a higher level of detail and realism. However, its ability to consistently produce HD results depends on several factors, including fast
