current location:Home > Technical Articles > Operation and Maintenance > Nginx

  • How to solve the problem of Nginx forwarding lost cookies
    How to solve the problem of Nginx forwarding lost cookies
    1. Lost Cookies Operation path one: http://localhost:8080/content/requestAction!showMainServiceReqDetail.action path two: http://localhost/content/requestAction!showMainServiceReqDetail.action path three: http://localhost/clp/ requestAction!showMainServiceReqDetail.action path one is direct access, path two is the same as path
    Nginx 2937 2023-05-15 21:10:12
  • How to achieve high availability by combining keepalived with nginx
    How to achieve high availability by combining keepalived with nginx
    1. Introduction keepalived is a high-availability solution for LVS services based on the vrrp protocol, which can be used to avoid single points of failure. An LVS service will have two servers running keepalived, one as the main server (master) and one as the backup server (backup), but it appears as a virtual IP to the outside world. The main server will send specific messages to the backup server. When the backup server When the server cannot receive this message, that is, when the main server goes down, the backup server will take over the virtual IP and continue to provide services, thereby ensuring high availability. keepalived is the perfect implementation of vrrp, so before introducing keepalived, let’s introduce v
    Nginx 1306 2023-05-15 21:07:12
  • How to configure Nginx virtual host in CentOS7.3
    How to configure Nginx virtual host in CentOS7.3
    Experimental environment A minimally installed centos7.3 virtual machine configures the basic environment 1. Install nginxyuminstall-yepel-*yumisntall-ynginxvim 2. Establish the site root directory of the virtual machine host mkdir/var/wwwrootmkdir/var/wwwroot/site1mkdir/var/ wwwroot/site2echo-e"site1">>/var/wwwroot/site1/index.htmlecho-e"site2">>/var/
    Nginx 1423 2023-05-15 20:55:19
  • How Docker runs nginx and mounts local directories into images
    How Docker runs nginx and mounts local directories into images
    1. Pull the image dockerpullnginx from hup. 2. Create the directory to be mounted: mkdir-p/data/nginx/{conf, conf.d, html, logs} 3. You must first have a configuration file to start the container 3.1vim/data/conf/nginx. confusernginx;worker_processes1;error_log/var/log/nginx/error.logwarn;pid/var/run/nginx.pid;events{worker_connections1024;}http{includ
    Nginx 1124 2023-05-15 20:25:16
  • What are the differences between Nginx and Apache?
    What are the differences between Nginx and Apache?
    Nginx, like Apache, is HTTP server software. Both adopt modular structure design in functional implementation. Both support common language interfaces, such as PHP, Perl, Python, etc., and also support forward and reverse proxies, virtual hosts, URL rewriting, compressed transmission, SSL encrypted transmission, etc. The main difference between Apache and NGINX is their design architecture. Apache uses a process-driven approach and creates a new thread for each request. NGINX uses an event-driven architecture to handle multiple requests in a thread. What is Apache HTTP server? Apache HTTP server is an open source cross-platform web server, also known as "httpd
    Nginx 5543 2023-05-15 19:46:04
  • How to deploy single-page application with Docker+Nginx
    How to deploy single-page application with Docker+Nginx
    From development to deployment, do it yourself. When we develop a single-page application, npmrunbuild will generate an index.html in the dist directory after executing the build. So how to deploy this index.html to the server? Directory structure dist/: Static files built by the front-end docker/: Configuration file configuration required for the mirror nginx picks a few configuration points to talk about. First, gzip compresses resources to save bandwidth and improve browser loading speed. Although webpack already supports it during build Just generate a .gz compressed package, but you can also enable gzipon through nginx;gzip_disable"msie6";#0-9, etc.
    Nginx 739 2023-05-15 19:40:19
  • How to solve the problem that nginx deployment vue project cannot find js css file
    How to solve the problem that nginx deployment vue project cannot find js css file
    Many times after npmrunbuild, the relative directory of the js file and css file automatically inserted by webpack in the index.html file is always wrong. After publishing it to the server, nginx cannot find the file. vue-cli@3 In vue-cli@3 you need to add a baseurl for all files that your webpack inserts into index.html. You need to create a new vue.config.js in the root directory of the project and add the following content:. ..module.exports={baseurl:isprod?'/basexxx/':&#3
    Nginx 2768 2023-05-15 19:40:12
  • How to configure pseudo-static and adapt client in nginx
    How to configure pseudo-static and adapt client in nginx
    The backend uses the thinkphp3.2.3 framework. If you are using other languages ​​or languages, please make appropriate modifications to server{listen80;server_namewww.morgen.club;#charsetkoi8-r;#access_loglogs/host.access.logmain;website root directory location/ {roothtml;indexindex.htmlindex.htm;#Set the access device set$source_device'index';#Judge it to be a mobile client or ipadif($ht
    Nginx 1365 2023-05-15 19:37:04
  • How to configure Nginx server to prevent Flood attacks
    How to configure Nginx server to prevent Flood attacks
    In the test, I will simply tell you how to configure the nginx limit request module and how it protects your website from being attacked by DDoS or other http-based denial of service attacks. In this test, I saved the sample page in blitz.io (now a free service) and named it about.html to test the limit_req directive. First, I used the following command on blitz to initiate 1075 concurrent requests It lasts for one minute, the response timeout is set to 2 minutes, the area is California, and all other states except status 200 are set to abnormal status. Even 503 is considered unsuccessful. -p1-1075:60-- status2
    Nginx 729 2023-05-15 18:52:06
  • How does Nginx cooperate with PHP to realize the function of generating real-time thumbnails?
    How does Nginx cooperate with PHP to realize the function of generating real-time thumbnails?
    nginx configuration: Copy the code as follows: #Assume that there is a file on the server: abc.jpg, and the original image can be accessed through http://filefs.domain.com/file/abc.jpg. In fact, generally, we only save the content of "/file/abc.jpg" in the database. #Now, we need to implement the thumbnail #abc.jpg.w320.jpg (w320, 320px width) automatically generated by the server through http://filefs.domain.com/file/abc.jpg.w320.jpg. and return image data. #The following two conditions must be met:
    Nginx 890 2023-05-15 18:37:06
  • How to install and configure Nginx in Ubuntu
    How to install and configure Nginx in Ubuntu
    1. Introduction to nginx nginx is a very lightweight http server. nginx, which is pronounced as "enginex", is a high-performance http and reverse proxy server, and is also an imap/pop3/smtp proxy server. 2. Support for PHP. Currently, there are three types of support for PHP by various web servers: (1) Through the built-in modules of the web server, such as apache's mod_php5, and similar apache's built-in mod_perl can support perl. (2) Implemented through cgi, which is just like the previous cgi of perl. The disadvantage of this method is poor performance, because every time the server encounters these scripts
    Nginx 1856 2023-05-15 18:07:25
  • How to configure Nginx static file server
    How to configure Nginx static file server
    Basic configuration server{listen80;server_namefile.52itstyle.com;charsetutf-8;#root directive is used to specify the base path of the file on the server root/data/statics;#location directive is used to map requests to the local file system location/{autoindexon ;#Index autoindex_exact_sizeon;#Display file size autoindex_localtimeon;#Display file time}} Restart nginx service: nginx-sreload access file service, http://
    Nginx 1768 2023-05-15 18:04:14
  • How to solve nginx deployment react refresh 404
    How to solve nginx deployment react refresh 404
    Solution to nginx deployment react refresh 404: 1. Modify Nginx configuration to "server{listen80;server_namehttps://www.xxx.com;location/{rootxxx;indexindex.htmlindex.htm;...}"; 2. Refresh Routing, just go to nginx to load the page according to the current path. nginx deploys a react application, and refreshes the route and reports 404. When nginx deploys a react single-page application, if you jump to a certain route and then refresh the current route, 404 will be reported. Personally, I think: react is a single-page application, and loading the page relies on routing, and the route
    Nginx 3367 2023-05-15 18:01:19
  • How to optimize Nginx high concurrency kernel
    How to optimize Nginx high concurrency kernel
    What is high concurrency? The default Linux kernel parameters consider the most common scenarios and are not suitable for web servers that support high concurrency access. Therefore, the Linux kernel parameters need to be modified, so that nginx can have higher performance; when optimizing the kernel, There are many things that can be done, but we usually make adjustments according to business characteristics. When nginx is used as a static web content server, a reverse proxy, or a server that provides a compression server, the adjustment of the kernel parameters is different. Here is the most suitable one. Common TCP network parameters that enable nginx to support more concurrent requests are simply configured; these require modifying /etc/sysctl.conf to change the kernel parameters. Configuration method configuration detailed analysis # represents a single
    Nginx 957 2023-05-15 17:52:06
  • What are Nginx proxy axios requests and precautions?
    What are Nginx proxy axios requests and precautions?
    1.nginx.conf configuration information Since there is a lot of nginx.conf configuration information, this article only focuses on axios and static resource request settings. By the way, some common configuration items will also be noted. The specific settings are as follows: #Set the http server and use its reverse proxy function to provide load balancing support http{#Connection timeout keepalive_timeout120;#gzip compression switch and related configuration gzipon;gzip_min_length1k;gzip_buffers432k;gzip_http_version1.1;gzip_comp_level2;gzip_typestext
    Nginx 1006 2023-05-15 17:43:06

Tool Recommendations

jQuery enterprise message form contact code

jQuery enterprise message form contact code is a simple and practical enterprise message form and contact us introduction page code.
form button
2024-02-29

HTML5 MP3 music box playback effects

HTML5 MP3 music box playback special effect is an mp3 music player based on HTML5 css3 to create cute music box emoticons and click the switch button.

HTML5 cool particle animation navigation menu special effects

HTML5 cool particle animation navigation menu special effect is a special effect that changes color when the navigation menu is hovered by the mouse.
Menu navigation
2024-02-29

jQuery visual form drag and drop editing code

jQuery visual form drag and drop editing code is a visual form based on jQuery and bootstrap framework.
form button
2024-02-29

Organic fruit and vegetable supplier web template Bootstrap5

An organic fruit and vegetable supplier web template-Bootstrap5
Bootstrap template
2023-02-03

Bootstrap3 multifunctional data information background management responsive web page template-Novus

Bootstrap3 multifunctional data information background management responsive web page template-Novus
backend template
2023-02-02

Real estate resource service platform web page template Bootstrap5

Real estate resource service platform web page template Bootstrap5
Bootstrap template
2023-02-02

Simple resume information web template Bootstrap4

Simple resume information web template Bootstrap4
Bootstrap template
2023-02-02

Cute summer elements vector material (EPS PNG)

This is a cute summer element vector material, including the sun, sun hat, coconut tree, bikini, airplane, watermelon, ice cream, ice cream, cold drink, swimming ring, flip-flops, pineapple, conch, shell, starfish, crab, Lemons, sunscreen, sunglasses, etc., the materials are provided in EPS and PNG formats, including JPG previews.
PNG material
2024-05-09

Four red 2023 graduation badges vector material (AI EPS PNG)

This is a red 2023 graduation badge vector material, four in total, available in AI, EPS and PNG formats, including JPG preview.
PNG material
2024-02-29

Singing bird and cart filled with flowers design spring banner vector material (AI EPS)

This is a spring banner vector material designed with singing birds and a cart full of flowers. It is available in AI and EPS formats, including JPG preview.
banner picture
2024-02-29

Golden graduation cap vector material (EPS PNG)

This is a golden graduation cap vector material, available in EPS and PNG formats, including JPG preview.
PNG material
2024-02-27

Home Decor Cleaning and Repair Service Company Website Template

Home Decoration Cleaning and Maintenance Service Company Website Template is a website template download suitable for promotional websites that provide home decoration, cleaning, maintenance and other service organizations. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-05-09

Fresh color personal resume guide page template

Fresh color matching personal job application resume guide page template is a personal job search resume work display guide page web template download suitable for fresh color matching style. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-29

Designer Creative Job Resume Web Template

Designer Creative Job Resume Web Template is a downloadable web template for personal job resume display suitable for various designer positions. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28

Modern engineering construction company website template

The modern engineering and construction company website template is a downloadable website template suitable for promotion of the engineering and construction service industry. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!