FortiWeb

Initial Server Policy Configuration in FortiWeb: A Step-by-Step Guide for Exposing a System Behind FortiWeb as Reverse Proxy

This article outlines the initial FortiWeb 7.6 configuration for exposing an internal system behind FortiWeb in reverse proxy mode. It focuses on Virtual Server, Server Pool, Protected Host and Server Policy, and provides GUI steps, CLI samples, SSL considerations, logging, health checks, and an operational checklist.

14 min read
  • پشتیبانی شبکه
  • Server
  • FortiWeb
  • Policy
  • Host
  • Certificate
  • backend
  • Pool
Initial Server Policy Configuration in FortiWeb: A Step-by-Step Guide for Exposing a System Behind FortiWeb as Reverse Proxy

خلاصه تخصصی مقاله

This article outlines the initial FortiWeb 7.6 configuration for exposing an internal system behind FortiWeb in reverse proxy mode. It focuses on Virtual Server, Server Pool, Protected Host and Server Policy, and provides GUI steps, CLI samples, SSL considerations, logging, health checks, and an operational checklist.

موضوعات اصلی: پشتیبانی شبکه، Server، FortiWeb، Policy، Host، Certificate

1. What is Server Policy in FortiWeb?

In FortiWeb, the Server Policy is the interface between the network, the backend, and the security layers. Simply put, it defines which Virtual Server FortiWeb should receive traffic from, which Server Pool to forward it to, and which security profiles and SSL/TLS settings to apply.

According to the CLI Reference version 7.6.6, FortiWeb applies only one Server Policy per connection. Therefore, the order, naming, Host Matching, Virtual Server, and Server Pool must be designed precisely; otherwise traffic may be forwarded to the wrong place or not inspected at all by FortiWeb.

Note In a Reverse Proxy scenario, the Server Policy is typically the most operationally important object in FortiWeb, because most key settings such as Virtual Server, Server Pool, Certificate, HTTP to HTTPS, HSTS, Web Protection Profile, HTTP/2, and logging are connected through this policy.

2. Main components of a Policy in FortiWeb 7.6

To ensure a correct Server Policy, several core objects must be prepared first. The recommended order is to define the Virtual Server and Server Pool first, and prepare Protected Host, HTTP Content Routing, Certificate, and Web Protection Profile as needed.

ObjectRole in FortiWebExample
Virtual ServerAddress and interface where FortiWeb receives user traffic.203.0.113.10:443
Server PoolList of one or more backend servers that receive requests.10.10.10.21:443, 10.10.10.22:443
Protected HostDomain name or Host Header allowed to be protected.app.example.com
CertificateSSL/TLS certificate FortiWeb uses for the client side.wildcard-example-com
Web Protection ProfileSecurity settings such as Signatures, HTTP Constraints, URL Access, Parameter Validation, Bot Mitigation.WPP-App-Initial-Monitor
Server PolicyFinal object that ties all the above together.SP-App-HTTPS

3. Example scenario for publishing a system

Consider a simple yet realistic scenario: an internal system hosted on two web servers, exposed to internet users via HTTPS.

ItemSample Value
Service FQDNapp.example.com
Public IP or VIP on FortiWeb203.0.113.10
First Real Server10.10.10.21:443
Second Real Server10.10.10.22:443
Operational ModeReverse Proxy
Client SideHTTPS/443
BackendHTTPS/443

Design consideration If Real Servers are directly reachable, it may bypass FortiWeb. Backend should be accessible only via FortiWeb or approved internal routes.

4. Prerequisites before creating Policy

Before you create a Server Policy in FortiWeb, ensure the following are defined. Missing details can lead to SSL errors, backend access issues, incorrect Host Headers, or ambiguous logs during testing.

  • Accurate service FQDN and DNS records
  • IP or VIP that users should reach
  • Interface receiving traffic on FortiWeb
  • Backend servers' IPs and ports
  • Backend HTTP or HTTPS usage
  • Client-side Certificate on FortiWeb
  • Need for SNI or a simple certificate suffices
  • HTTP to HTTPS Redirect requirement
  • Initial Web Protection Profile in Monitor or Block mode
  • Logging path on FortiWeb and FortiAnalyzer

5. Step 1: Create the Virtual Server

The Virtual Server defines on which interface and which IP FortiWeb receives traffic. In a Reverse Proxy setup, the Destination IP seen by the client is typically the Virtual Server IP.

Server Objects → Server → Virtual Server → Create New

FieldSample Value
NameVS-App-HTTPS
Interfaceport1
IP Address203.0.113.10
StatusEnable

Sample CLI

  • config server-policy vserver edit "VS-App-HTTPS"
  • config vip-list edit 1
  • set interface "port1"
  • set vip "203.0.113.10"
  • set status enable
  • next
  • end
  • next
  • end

Note The Virtual Server is not the backend. The Virtual Server is where FortiWeb receives user traffic; the backend is defined in the Server Pool.

6. Step 2: Define Server Pool and Real Server

Server Pool groups one or more backend servers that FortiWeb forwards requests to. In Reverse Proxy, FortiWeb can distribute between pool servers, e.g., by Round Robin or Least Connections.

Server Objects → Server → Server Pool → Create New

FieldValue
NamePOOL-App-HTTPS
TypeReverse Proxy
Load BalancingRound Robin / Least Connections
Server 110.10.10.21:443
Server 210.10.10.22:443
SSL to BackendEnable

Sample CLI

  • config server-policy server-pool edit "POOL-App-HTTPS"
  • set type reverse-proxy
  • set protocol HTTP
  • set lb-algo round-robin
  • set server-balance enable
  • config pserver-list edit 1
  • set server-type physical
  • set ip 10.10.10.21
  • set port 443
  • set ssl enable
  • set status enable
  • next
  • edit 2
  • set server-type physical
  • set ip 10.10.10.22
  • set port 443
  • set ssl enable
  • set status enable
  • next
  • end
  • next
  • end

Health Check

If multiple backends exist, Health Check is essential. Without a proper Health Check, FortiWeb may route traffic to a backend that is down or returning incorrect HTTP responses.

Health Check path can be simple TCP/443; for sensitive systems, verify the real path such as a login page or health endpoint. Example: GET /health

7. Step 3: Define Protected Host Names

Protected Host defines which Host Header value FortiWeb should consider valid for this service. If the service is published for a specific FQDN, defining Protected Host helps to validate requests with unknown or incorrect Host headers at the WAF layer.

Server Objects → Protected Hosts → Create New

FieldValue
NameHOST-App
Hostapp.example.com

Sample CLI

  • config server-policy allow-hosts edit "HOST-App"
  • config allow-hosts-list edit 1
  • set host-type fqdn
  • set host "app.example.com"
  • next
  • end
  • next
  • end

Operational note Protected Host is different from Real Server. Protected Host relates to the HTTP Host Header used by the client; Real Server is typically the internal backend IP.

8. Step 4: Prepare Certificate and HTTPS

If users access the service via HTTPS, a certificate must exist on FortiWeb. This may be a certificate for the FQDN, a wildcard certificate, or an SNI configuration.

System → Certificates → Local → Import

For simple scenarios, select a certificate on the Server Policy. If multiple FQDNs share one IP, consider SNI.

ScenarioRecommendation
One domain on one IPOne Local Certificate on the Server Policy is enough.
Multiple domains on one IPUse SNI Configuration or Certificate Group.
HTTPS from FortiWeb to BackendEnable SSL in Real Server entries within the Server Pool.
HTTP to HTTPSEnable HTTP-to-HTTPS on the Server Policy.

9. Step 5: Choose the initial Web Protection Profile

Web Protection Profile combines FortiWeb security settings. If you are unsure about application behavior, start with a conservative profile in Monitoring mode and enable logging; adjust actions later based on logs.

Policy → Web Protection Profile → Inline Protection Profile

Recommendations for initial config

  • Signatures: start in Alert/Monitor mode
  • HTTP Protocol Constraint: avoid overly strict values initially
  • Parameter Validation: enable only after parameters are known
  • Bot Mitigation: enable carefully on specific paths such as login
  • Upload/Download Paths: validate separately

Warning A common pitfall is enabling all security modules to Block on first release, which may cause false positives and service disruption. Start with visibility and full logging, then tighten the policy.

10. Step 6: Create the Server Policy

With Virtual Server, Server Pool, Protected Host, Certificate and Web Protection Profile prepared, create the Server Policy. This policy defines that inbound HTTPS traffic from the Virtual Server is forwarded to the internal Server Pool with the Web Protection Profile applied along the way.

Policy → Server Policy → Server Policy → Create New

FieldSuggested Value
NameSP-App-HTTPS
Deployment ModeServer Pool
Virtual ServerVS-App-HTTPS
Server PoolPOOL-App-HTTPS
Protected Host NamesHOST-App
ServiceHTTPS
Certificatewildcard-example-com
Web Protection ProfileWPP-App-Initial-Monitor
StatusEnable

Sample CLI

  • config server-policy policy edit "SP-App-HTTPS"
  • set status enable
  • set protocol HTTP
  • set deployment-mode server-pool
  • set vserver "VS-App-HTTPS"
  • set server-pool "POOL-App-HTTPS"
  • set allow-hosts "HOST-App"
  • set service "HTTPS"
  • set HTTPS-service "HTTPS"
  • set ssl enable
  • set certificate "wildcard-example-com"
  • set HTTP-to-HTTPS enable
  • set hsts-header enable
  • set hsts-max-age
  • set web-protection-profile "WPP-App-Initial-Monitor"
  • set monitor-mode enable
  • set client-real-ip disable
  • set syncookie enable
  • next
  • end

Note Object names may differ in your environment. Verify exact object names with show/edit queries before running CLI.

When to enable Client Real IP?

In Reverse Proxy mode, the backend typically sees FortiWeb's IP. If you need the backend to see the actual client IP, enable Client Real IP, but ensure correct return routing and gateway configuration. Often using headers like X-Forwarded-For is sufficient and less risky.

11. Test, logging and initial troubleshooting

After Server Policy creation, simply loading the homepage is not enough. Validate SSL, Host Header, login path, uploads, APIs, redirects and logs.

Basic client-side tests

  • curl -vk https://app.example.com/
  • curl -vk -H "Host: app.example.com" https://203.0.113.10/
  • curl -I http://app.example.com/
  • curl -I https://app.example.com/

Logs to check

  • Traffic Log for requests
  • Attack Log for Signature matches or Policy violations
  • Initial actions: Alert vs Deny
  • Host Header visibility
  • Backend latency or server response time
  • SSL handshake errors

Log & Report → Log Access → Traffic

Log & Report → Log Access → Attack

12. Common mistakes in initial FortiWeb configuration

Common MistakePotential ImpactSolution
Confusing Virtual Server with Backend ServerTraffic may not match a policy or go to the wrong destinationDefine Virtual Server for the user-facing IP and Server Pool for the backend
Not defining Protected HostRequests from unknown hosts may pass into the policyCreate Protected Host for each primary FQDN
Starting with Block on day oneFalse positives and service disruptionStart with Monitor/Alert, tighten gradually
No proper Health CheckTraffic may go to a faulty or down backendDefine real health checks per service
Direct access to BackendBypass FortiWebRestrict direct access on Firewall or routing
Wrong certificate selectionSSL errors or browser warningsUse correct certificate, key and chain for the FQDN

13. Best Practice recommended by XNET

  • For each critical system, create separate Server Policy and avoid reusing generic policies
  • Standardize naming: prefix objects with VS, POOL, HOST, WPP and SP
  • In early release, start with lower-risk actions in Web Protection Profile and tighten after logs
  • Define Protected Host for each FQDN to validate Host Headers
  • If backend uses HTTPS, review SSL on backend and Certificate verification separately
  • For sensitive services, health checks should verify real service path, not just TCP
  • Limit user direct access to backend via firewall or routing
  • Before service handover, verify Traffic and Attack logs and send logs to FortiAnalyzer

14. Final checklist before service handover

ItemTarget State
DNSFQDN resolves to the correct IP or VIP on FortiWeb
Virtual ServerInterface, IP and Status configured correctly
Server PoolAll backends defined with IP, port, SSL and Health Check
Protected HostAuthorized FQDNs defined
CertificateCertificate, Private Key and Chain complete
Server PolicyVirtual Server, Server Pool, Protected Host, Certificate and Web Protection Profile linked to Policy
HTTP to HTTPSRedirect enabled and tested if required
LoggingTraffic and Attack logs visible in FortiWeb and FortiAnalyzer
Security ProfileInitially enabled in a controlled mode, then switched to Block after log review
Bypass PreventionDirect access to Backend from outside or unauthorized networks blocked

برای ارزیابی پایداری، امنیت و نگهداری این زیرساخت، راهنمای پشتیبانی شبکه را نیز مطالعه کنید.