Home Operation and Maintenance Linux Operation and Maintenance How to configure the security settings of Nginx server through the Pagoda panel

How to configure the security settings of Nginx server through the Pagoda panel

Jun 21, 2023 pm 01:10 PM
pagoda panel nginx server Security Settings

With the popularity of the Internet, the number of websites has also increased. Due to cost and convenience considerations, many websites choose to use Nginx servers. But the security of Nginx server still needs us to continuously strengthen. As an excellent web server management tool, Pagoda Panel's security functions also provide great convenience to the majority of webmasters. Next, the author will introduce how to perform security settings on the Nginx server through the Pagoda panel.

1. Change the SSH default login port

SSH is a protocol used to remotely manage your services and file systems, and is often used for server security maintenance. In order to improve the security of the server, we should change the default login port of SSH to a non-common port. You can do this through the following steps:

  1. After logging in to the Pagoda panel, click "SSH" in the left navigation bar, find the "SSH Port" option and modify it. You can customize an unused port that is greater than 1024 and less than 65535. It is recommended not to use too conspicuous numbers.
  2. After the modification is completed, the modified port should be opened in the firewall in time, otherwise the SSH connection will not be successful. It can be operated through the "Firewall" in the Pagoda panel.

2. Set up the Nginx security module

The ngx_http_secure_link module that comes with the Nginx server provides a set of security algorithms to ensure the legitimacy of the HTTP request source. It can effectively prevent malicious requests or links from being accessed frequently, thereby increasing the load on the server. You can set it up through the following steps:

  1. After logging in to the Pagoda panel, click "Website" in the left navigation bar, find the "Nginx" option and enter.
  2. In the "Nginx" settings page, click the "Advanced Features" option and select "Advanced Configuration File" in the pop-up window.
  3. Add the following code to the advanced configuration file:
location /download/ {
  secure_link $arg_sec_key,$arg_expires;
  secure_link_md5 "$secure_link_expires$uri$remote_addr mysecretkey";
  if ($secure_link = "") { return 403; }
  if ($secure_link = "0") { return 410; }
}
Copy after login

Among them, "mysecretkey" should be replaced with your own key.

  1. After the modification is completed, the Nginx server should be restarted to make the settings take effect. It can be operated in "Service Management" in the Pagoda Panel.

3. Turn on anti-hotlinking

Anti-hotlinking can prevent unauthorized sites from using your pictures and videos, thereby protecting your site content and traffic and reducing server pressure. You can set it up through the following steps:

  1. After logging in to the Pagoda panel, click "Website" in the left navigation bar, find the "Nginx" option and enter.
  2. In the "Nginx" settings page, click the "Advanced Features" option and select "Advanced Configuration File" in the pop-up window.
  3. Add the following code to the advanced configuration file:
location ~* .(gif|jpg|jpeg|png|flv|mp4|mp3|wmv|avi|ogg|swf)$ {
  valid_referers none blocked *.example.com;
  if ($invalid_referer) {
    return 403;
  }
}
Copy after login

Among them, "example.com" should be replaced with your own site domain name.

  1. After the modification is completed, the Nginx server should be restarted to make the settings take effect. It can be operated in "Service Management" in the Pagoda Panel.

Summary:

It is essential to take some security measures, especially when your server carries important data or business applications, so it is recommended that you update the Nginx server Set for strict security. Through the simple operation of the pagoda panel, you can add a solid defense wall to the server.

The above is the detailed content of How to configure the security settings of Nginx server through the Pagoda panel. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1653
14
PHP Tutorial
1251
29
C# Tutorial
1224
24
A brief analysis of the problem that the server cannot be remote after installing Pagoda A brief analysis of the problem that the server cannot be remote after installing Pagoda Nov 23, 2022 pm 04:56 PM

This article uses the Pagoda Panel Tutorial column to introduce to you the problem that server2022 cannot be remote after installing Pagoda. I wonder if you have encountered such a problem? Let me show you how I handle it!

How to set up security settings in 360 Extreme Browser How to set up security settings in 360 Extreme Browser Jan 29, 2024 pm 09:51 PM

How should 360 Speed ​​Browser perform security settings? When we use 360 ​​Speed ​​Browser, how should we perform security settings? Let’s introduce it below! We usually use 360 ​​Speed ​​Browser to browse the web. When we use it, we are worried that harmful websites will invade our browser, so we will make some security settings. So how to set them up specifically? The editor has compiled the 360 ​​Speed ​​Browser below. Detailed operation of security settings. If you don’t know how, follow me and read on! Detailed operations for security settings on 360 Speed ​​Browser 1. Open 360 Speed ​​Browser, find the icon with three horizontal lines in the upper right corner, and click to enter. 2. Enter the main settings menu, find the "Options" below, and click to enter. 3. After entering the "Options" interface, on the left

How to set the speed limit of the virtual host through the Pagoda panel How to set the speed limit of the virtual host through the Pagoda panel Jun 21, 2023 am 11:17 AM

Pagoda Panel is a very excellent server management panel under Linux system. It has powerful functions and friendly interface, which can help users manage servers easily. In the process of using the Pagoda Panel, it is sometimes necessary to limit the speed of the virtual host to ensure the stability and fluency of the server. This article will introduce how to set the speed limit of the virtual host through the Pagoda panel to achieve a good user experience. 1. Overview of Speed ​​Limit Speed ​​limit refers to limiting the host bandwidth and ensuring the normal operation of the server by controlling the host traffic. exist

PHP file permission management and security settings PHP file permission management and security settings Aug 08, 2023 pm 02:51 PM

PHP file permissions are one of the important measures to protect file security on the server. Properly setting file permissions can prevent malicious users from modifying, deleting, or executing malicious code on files. Therefore, when developing and deploying PHP applications, file permissions must be correctly set and managed to ensure application security. 1. Basic concepts File permissions are divided into three levels, namely user (Owner), user group (Group) and other users (Other). Each level has three permissions, namely read (Re

How to solve the 'Security settings change problem that prompts the pin code is no longer available after Win11 is turned on' How to solve the 'Security settings change problem that prompts the pin code is no longer available after Win11 is turned on' Jan 29, 2024 pm 02:27 PM

When we use win11 system, we will set the pin code to help our computer data. However, many users also show that the security settings on this device have been changed when setting the pin code, and the pin code is no longer available. So what should we do? manage? Users can go into the troubleshooter to make settings. Let this site give users a detailed introduction to what to do if Win11 starts up and it shows that the security settings on this device have been changed and the pin code is no longer available? Bar. What should I do if it shows that the security settings on this device have been changed and the pin code is no longer available when booting up Windows 11? First, on the page where your PIN is unavailable and you need to reset your PIN, hold down the shift key and select Restart. Please wait later will appear, and then enter the reset

Introduction to the WebDAV file management function of Pagoda Panel Introduction to the WebDAV file management function of Pagoda Panel Jun 21, 2023 am 11:33 AM

Introduction to the WebDAV file management function of Pagoda Panel WebDAV is a file management technology based on the HTTP protocol. It allows users to access files on the network through the HTTP protocol and manage these files. With the support of WebDAV technology, we can build a Web server to provide various network services. Pagoda Panel is a popular web server management tool that provides a wealth of functional modules, among which the WebDAV file management function is one of them. Below, this article

Security settings for Nginx access control list (ACL) Security settings for Nginx access control list (ACL) Jun 10, 2023 pm 09:55 PM

In today's Internet environment, security has become an important part of any system. Nginx is one of the most popular web servers currently, and its access control list (ACL) is an important tool for protecting website security. A well-set Nginx ACL can help you protect your server and website from attacks. This article will discuss how to set up Nginx access control lists to ensure the security of your website. What is Nginx Access Control List (ACL)? ACL(AccessCon

Nginx HTTP2 protocol optimization and security settings Nginx HTTP2 protocol optimization and security settings Jun 10, 2023 am 10:24 AM

As the Internet continues to develop and improve, Web servers have increasingly higher requirements for speed and performance. To meet such demands, Nginx has successfully mastered the HTTP2 protocol and incorporated it into its server's performance. The HTTP2 protocol is more efficient than the earlier HTTP protocol, but it also has specific security issues. This article will introduce you in detail how to optimize Nginx's HTTP2 protocol and security settings. 1. Nginx HTTP2 protocol optimization 1. Enable HTTP2 in N

See all articles