Skip to main content

Web Servers & Tools

Web Servers & Tools

How to Host OpenProject on a Linux Server using Docker and Nginx Reverse Proxy

DevOps Guide: Running OpenProject alongside Magento 2

Magento 2 environments are notoriously complex. Adding a Project Management tool like OpenProject to the same server can be risky if dependencies clash. The solution? Docker Isolation.


Step 1: Generate a Unique Security Key

Before launching, generate a random 32-character secret key for session encryption.

Prevent Search Engines from crawling the url with queries and try it

RewriteEngine On
RewriteBase /
# Target search engine bots
RewriteCond %{HTTP_USER_AGENT} (Googlebot|Google-InspectionTool|bingbot|Slurp|DuckDuckBot|Yandex|Baiduspider) [NC]
# Rule 1: Return 410 for any URL with a query string (for search engines only)
RewriteCond %{QUERY_STRING} .+
RewriteRule ^ - [G]

if you want to exclude the sitemap.xml from this then do it like this 

 

Configuring Next.js app for redirection while whitelisting specific IPs.

Configuring Next.js app for redirection while whitelisting specific IPs.

Below is the code that enables the execution of a Next.js application for specific IP addresses while redirecting other users to the primary website.

 

#RewriteEngine On
## WH
RewriteCond %{REMOTE_ADDR} !10\.10\.10\.10$
RewriteCond %{REMOTE_ADDR} !11\.11\.11\.11$


RewriteRule ^(.*)$ https://www.live-website.com/$1 [L,R=301]

Title: Redirecting All Users to HTTPS, Except for Specific IPs Using .htaccess

Introduction:
In web development, sometimes you may want to redirect all users accessing your website to a specific URL, such as www.example.com. However, there might be certain cases where you need to exclude specific IP addresses from this redirection. In this article, we will explore how to achieve this using the .htaccess file.

NextJs htaccess setting

The content of the .htaccess for nextjs application is

# Redirect traffic to your port 3001
DirectoryIndex
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)?$ http://127.0.0.1:3001/$1 [P,L]
 

to exclude a file from this rule (EX: test.txt) we can add this like 

RewriteCond %{REQUEST_URI} !test\.txt [NC]

 

Full Code