Skip to main content
infervour.com

infervour.com

  • How to Block A PHP File Request In Nginx? preview
    9 min read
    To block a PHP file request in Nginx, you can follow these steps:Open the Nginx configuration file for your website or server block. This file is usually located at /etc/nginx/nginx.conf or /etc/nginx/sites-available/default or specific to your site configuration. Inside the configuration file, locate the server block for the intended website or create a new one if needed. To block PHP file requests, add the following snippet inside the server block: location ~ \.

  • How to Remove .Php Extension From A URL In Nginx? preview
    5 min read
    To remove the .php extension from a URL in Nginx, you can use the following configuration in your Nginx server block: location / { try_files $uri $uri/ $uri.php?$args; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } Explanation:The location / block checks for the existence of requested files or directories.

  • How to Configure Cors on Nginx? preview
    5 min read
    To configure CORS (Cross-Origin Resource Sharing) on Nginx, you can follow these steps:Open the Nginx configuration file using a text editor. This file is typically located in the /etc/nginx directory and is named nginx.conf. Within the http block, add the following code snippet to enable CORS: http { ...

  • How to Directly Access Ingress-Nginx Inside Minikube? preview
    9 min read
    To directly access ingress-nginx inside Minikube, you can follow these steps:Start Minikube: Run the following command to start Minikube: minikube start Ensure that Minikube is up and running before proceeding to the next step.Enable the NGINX Ingress controller: First, enable the NGINX Ingress controller addon in Minikube by executing the following command: minikube addons enable ingress This will start the NGINX Ingress controller pod in the kube-system namespace.

  • How to Configure the Nginx Proxy Inside A Docker Container? preview
    9 min read
    When configuring the Nginx proxy inside a Docker container, you can follow these steps:Create a new Dockerfile: Start by creating a new file, e.g., Dockerfile, in your project folder. Use the appropriate base image, like nginx or alpine, in your Dockerfile. Use the FROM directive to specify the base image to use. Copy Nginx configuration files: Copy your Nginx configuration files to the Docker container. Use the COPY directive to copy the configuration files from the host into the container.

  • How to Deploy the Next.js And Laravel Projects With Nginx? preview
    10 min read
    To deploy a Next.js and Laravel project with Nginx, you can follow these steps:Set up the server: Start by setting up a server with Nginx installed. This can be a virtual private server (VPS) or any other server environment of your choice. Install Node.js and PHP: Next.js requires Node.js to run, so you'll need to install Node.js on your server. Laravel requires PHP, so ensure that PHP is also installed on the server.

  • How to Change the Client_max_body_size Of Nginx In Docker? preview
    6 min read
    To change the client_max_body_size of Nginx in Docker, you can follow these steps:Locate the Nginx configuration file: In your Docker container, the Nginx configuration file is usually located at /etc/nginx/nginx.conf. This file contains all the server configurations. Edit the Nginx configuration file: Open the configuration file using a text editor (e.g., vi, nano, etc.). Look for the http block, which contains various server configurations.

  • How to Strip Unwanted Parameters From A URL With Nginx? preview
    11 min read
    To strip unwanted parameters from a URL using nginx, you can use the $args variable in combination with the rewrite directive. Here is how you can do it:Open your nginx configuration file using a text editor. This file is usually located at /etc/nginx/nginx.conf. Within the server block or a specific location block, add the following rewrite directive: location / { ... rewrite ^([^?]*)(?:\?(?!key=)[^&]+)*$ $1 permanent; ...

  • What Does $Connection_time Mean In Nginx? preview
    7 min read
    $connection_time is a variable in Nginx that represents the total time it took to establish a connection with a client. It measures the duration from when the connection process begins until it is completed or terminated. This variable is commonly used in log files and for monitoring purposes to analyze server performance and identify any potential bottlenecks. By examining $connection_time, administrators can gain insights into network latency, connection quality, and overall system health.

  • How to Change the Root Path In the Nginx Configuration? preview
    6 min read
    To change the root path in the nginx configuration, you need to make some adjustments in the server block of the configuration file. Follow the steps below:Open the nginx configuration file using a text editor. The main configuration file is typically located at /etc/nginx/nginx.conf or /etc/nginx/conf.d/default.conf. However, it can vary depending on your system. Locate the relevant server block. In most cases, it starts with server { and ends with }.

  • How to Implement Basic NGINX Rate Limiting? preview
    9 min read
    To implement basic rate limiting with NGINX, you can follow these steps:Open your NGINX configuration file (usually located at /etc/nginx/nginx.conf or /etc/nginx/conf.d/default.conf) using a text editor. Inside the http block, add the following code snippet to define a new limit_req_zone: http { ... limit_req_zone $binary_remote_addr zone=mylimit:10m rate=1r/s; ...