Problem Overview: 504 Gateway Timeout on the S7-1500 CPU Web Server
The SIMATIC S7-1500 web server is an embedded HTTP/HTTPS service that runs directly on the CPU and exposes diagnostic pages, tag browsers, data logs, trace recordings, and (optionally) user-defined HTML/JavaScript pages served from the load memory. Under normal conditions, navigating to http://<cpu-ip> returns the standard Welcome page within one to three seconds on a 100 Mbit/s direct connection. A 504 Gateway Timeout is a distinctive failure mode: it means the CPU accepted the HTTP request and forwarded it to an upstream page provider, but never received a complete response inside the internal timeout window.
This is not a browser bug. The HTML body returned in a 504 originates from the CPU firmware, not from the PC. The 504 Gateway Timeout message is most commonly seen when user-defined web pages are enabled but the resource provider (either the project path configured in TIA Portal or an external HTTP server referenced by the page set) cannot be reached by the CPU when it tries to assemble the response. It can also be triggered by an HTTPS redirect that the embedded web server cannot complete, or by a corrupted page set that was transferred to the SIMATIC Memory Card.
This article focuses on the field case of a CPU 1515F-2 PN (Siemens article number 6ES7515-2FM02-0AB0) running firmware V2.0 with hardware release V3.0, configured with the IP address 192.168.5.144, and accessed directly (no router) over an Ethernet patch cable from an engineering PC running TIA Portal. The diagnostic methodology, however, applies to the entire S7-1500 / ET 200SP CPU family running firmware V1.8 through V2.9.
ping 192.168.5.144, the failure is at layer 3 and the 504 page you are seeing is most likely cached in the browser. Clear the browser cache and verify the L3 path before continuing.CPU Identification and Firmware Status
Before changing any configuration, capture the exact identity of the controller. The PLC reports its identity in the standard web pages; if the welcome page is not reachable, read it from the engineering project or directly from the module.
| Parameter | Value in this case | How to verify |
|---|---|---|
| Article number (MLFB) | 6ES7515-2FM02-0AB0 | Printed on the front module, or TIA Portal > Online > Accessible nodes |
| Firmware version | V2.0 | TIA Portal > Online > Diagnostics > Online & Diagnostics |
| Hardware version | V3.0 | Module label and TIA Portal device properties |
| IP address | 192.168.5.144 / 255.255.255.0 | Display on CPU front, or web server standard page (if reachable) |
| MAC address | XX-XX-XX-XX-XX-XX | Front label behind the door |
For firmware V2.0 of the CPU 1515F-2 PN, the web server supports HTTP on TCP/80 and HTTPS on TCP/443 (configurable). The user-defined web pages feature has been available since firmware V1.5, but the runtime behavior changed in V2.0: the CPU now performs strict MIME-type validation on transferred page resources and applies a 30 second response timeout for any page provider it cannot reach on the engineering station.
Refer to the SIMATIC S7-1500 Web Server Function Manual (Entry ID 59191792) for the authoritative list of supported browsers and the per-firmware behavior. Always cross-check the firmware release notes against the KB article SIMATIC S7-1500 S7-1500/ET 200MP System Manual (Entry ID 109744384).
Root Cause Analysis of the 504 Response
On the S7-1500 firmware V2.x web server, the 504 Gateway Timeout is generated by the page provider handler. Three primary fault paths produce it:
-
User-defined web pages are enabled in TIA Portal but the resource folder does not exist or is unreachable. The CPU attempts to read
index.htm,logo.png, and referenced CSS/JS files from the configured source path. If the engineering station path is unmapped, on a disconnected drive, or behind a firewall that the CPU cannot bypass, the embedded web server eventually times out and returns 504. - A redirect or proxy rule inside the user-defined page set points to an unreachable host. Some template pages include external CDN references (jQuery, Bootstrap). When the CPU tries to resolve these references through the page provider and the network path is blocked, the response completes only after the internal timeout.
- The page set was compiled against a newer TIA Portal version than the firmware supports. For CPU 1515F-2 PN with firmware V2.0, only page sets compiled with TIA Portal V13 SP1 Update 4 through V15 are fully compatible. Page sets generated with TIA Portal V16 or later rely on AWP tags and JavaScript helpers that the V2.0 web server does not recognize; the CPU stalls waiting for a parser response and eventually returns 504.
A secondary cause, frequently overlooked, is the CPU's own IPv4 router configuration. If the CPU has been assigned an IP address outside the PC's subnet (for example PC on 192.168.0.x/24 while CPU is 192.168.5.144/24), the browser request can reach the CPU, but the CPU cannot reply because it has no router entry. The result is a 504 on the client side, even though the link layer (link LEDs, ARP) is up. The classic symptom is that ping works intermittently or not at all while the CPU display still shows the configured IP.
Prerequisites for Troubleshooting
Before any web server configuration change, gather the following items. Without them, the troubleshooting steps below cannot produce a deterministic result.
- Latest TIA Portal version compatible with firmware V2.0 (recommended: TIA Portal V15.1 Update 9 or V16 with the V2.0 HSP installed)
- Engineering project archive (.zap15 or .zap16) showing the original CPU configuration
- Administrator credentials for the engineering PC (needed to clear DNS cache, restart services, edit hosts file)
- Direct Ethernet patch cable (CAT5e or better) and the ability to set a static IPv4 address on the PC Ethernet adapter
- Siemens PRONETA or the TIA Portal "Accessible nodes" function for diagnostic discovery
- The S7-1500 web server manual and the CPU's firmware release notes
Step-by-Step Troubleshooting Procedure
Work the steps in order. Each step is independently verifiable, and earlier steps isolate issues that would otherwise mask later diagnostics.
Step 1 - Verify Layer 3 Connectivity
- Open Control Panel > Network and Sharing Center > Ethernet > Properties > Internet Protocol Version 4 on the engineering PC.
- Set a static address in the same /24 subnet as the CPU. For the example CPU on
192.168.5.144/255.255.255.0, set the PC to192.168.5.10with subnet mask255.255.255.0and leave the default gateway blank so the PC does not try to route through a non-existent router. - From an elevated command prompt, run
arp -d *thenping 192.168.5.144 -t. - If ping fails, swap the patch cable, try a different port on the CPU (port 1 or port 2 of the PROFINET interface), and verify the link LED on the CPU front is solid green.
If ping does not work, the rest of the procedure is irrelevant. The web server requires a working L3 path before HTTP will respond at all.
Step 2 - Bypass the User-Defined Page Set Temporarily
- Open the project in TIA Portal.
- Select the CPU 1515F-2 PN and open Properties > Web server > User-defined web pages.
- Uncheck "Enable user-defined web pages" (or, in older TIA Portal versions, uncheck "Use the web pages from this project").
- Confirm that "Enable web server on this CPU" is still checked.
- Compile the project (right-click CPU > Compile > Hardware and Software).
- Download to the CPU (Online > Download to device) and confirm the CPU does not switch to STOP. If it does, choose Download to device > Hardware configuration and acknowledge the STOP/RUN transition.
- Restart the CPU web server from Online > Online & Diagnostics > Web server > Restart. This is a documented function in the S7-1500 Web Server Function Manual.
Open Chrome, Firefox, or Edge in an Incognito/Private window and browse to http://192.168.5.144. If the standard Siemens welcome page appears, the fault is in the user-defined page set. Proceed to Step 3.
Step 3 - Rebuild and Re-Deploy the User-Defined Page Set
- In TIA Portal, re-enable the user-defined web pages option.
- Click Browse next to the resource path field and select the project folder that contains the page set's root HTML file (typically
index.htm). - Verify that the folder physically exists at that absolute path on the engineering PC. UNC paths and mapped network drives are not supported for V2.0 firmware; use a local path such as
C:\Projects\MachineA\Webpages. - Remove any references to external CDNs from the HTML/JavaScript. Inline all jQuery, Bootstrap, and Font Awesome assets directly in the page set.
- Compile only the web server pages (CPU > Compile > Web server pages) and download only the web server change (Online > Download web server data).
- Restart the web server as in Step 2.7.
Step 4 - Validate the HTML Against the AWP Syntax
S7-1500 user-defined web pages use Siemens-specific AWP (Automation Web Programming) commands. Pages that contain malformed AWP tags cause the embedded parser to hang. Validate every page with the following rules:
- Every
<!-- AWP_<tag> -->block must be balanced; unclosed blocks stall the parser. - Tag references like
:="DB1"."Motor_Speed":must point to data blocks that are not optimized (non-optimized DBs only on firmware V2.0). Optimized blocks cause the parser to time out. - Frame sets (
<frameset>) are deprecated; use iframes or single-page layouts.
Full syntax reference is in the S7-1500 Web Server Function Manual, section on AWP commands.
Step 5 - Clear Browser and OS State
- Flush DNS on the PC:
ipconfig /flushdns. - Clear Chrome cache (Settings > Privacy and security > Clear browsing data > Cached images and files) or Firefox equivalent.
- Disable any browser extensions that inject headers (corporate proxies, antivirus HTTPS scanners). These can intercept the response and report 504 on behalf of the PLC.
- Test with
curl -v http://192.168.5.144from the command line. Ifcurlreceives the Siemens welcome page but the browser does not, the problem is on the client side.
Network Connectivity Verification Matrix
| Test | Command | Expected result | If it fails |
|---|---|---|---|
| L1 link | CPU port LED | Solid green link, blinking yellow activity | Cable, port, or CPU hardware fault |
| L2 ARP | arp -a |
192.168.5.144 maps to CPU MAC | Re-seat cable; check VLAN tagging on managed switches |
| L3 ICMP | ping 192.168.5.144 |
Reply < 1 ms typical | Verify IP/subnet/gateway; PC and CPU must share subnet |
| L4 TCP open |
Test-NetConnection 192.168.5.144 -Port 80 (PowerShell) |
TcpTestSucceeded: True | Web server disabled; wrong port; firewall on engineering PC |
| L7 HTTP GET | curl -v http://192.168.5.144 |
HTTP 200 with HTML body | Review server response code (404, 500, 503, 504) |
TIA Portal Configuration Verification
Open the device configuration for the CPU 1515F-2 PN and audit the following items in Properties > Web server:
| Setting | Recommended value for FW V2.0 | Notes |
|---|---|---|
| Enable web server on this CPU | Checked | Master switch for the service |
| Permit access only with HTTPS | Optional (unchecked recommended for diagnostic access) | Forcing HTTPS on FW V2.0 without a valid certificate can break browser trust chains |
| Enable user-defined web pages | Checked only if a valid page set is compiled | Disable first to isolate standard pages |
| HTML directory / resource path | Local absolute path, ASCII characters only | No UNC, no mapped drives, no spaces in folder names |
| Automatic update | Checked | Transfers page set on every download |
| User management | At least one user with role Administrator or Diagnostics | No user means the welcome page is read-only |
After every change, recompile (Ctrl+B) and download only the web server data, not the full hardware configuration, to minimize CPU stop time.
Browser Compatibility Considerations for Firmware V2.0
The supported browser list for firmware V2.0 is more restrictive than for newer firmware versions. Per the S7-1500 Web Server Function Manual, the following browsers are validated by Siemens for V2.0:
- Microsoft Internet Explorer 11 (32-bit) - the only fully validated browser for the AWP debugging interface
- Mozilla Firefox ESR 52.x through 60.x
- Google Chrome up to version 65
Modern Chrome (≥ 100) and Edge (chromium-based) introduce stricter TLS handling and same-site cookie enforcement that can interfere with the V2.0 web server session handling. Symptoms include a 504 on the second navigation after login, or the standard welcome page loading but the diagnostic tabs returning 504. If you must use a modern browser, upgrade the CPU firmware to V2.6 or later. Firmware V2.6 introduces HTTP/1.1 keep-alive improvements and updated TLS handling validated against current browsers.
HTTP Response Behavior on Port 80 and 443
The S7-1500 web server listens on port 80 for HTTP and 443 for HTTPS by default. The configuration in Properties > Web server > Connection allows changing these ports. Common pitfalls:
- If the CPU has been configured to redirect all HTTP requests to HTTPS (the "Automatic forwarding to HTTPS" option), a browser that does not trust the self-signed certificate will display a connection error that mimics a timeout. Either install the CPU certificate into the Windows Trusted Root Certification Authorities store or disable the redirect temporarily.
- If port 443 is occupied by another service on the PC (for example, IIS for Visual Studio debugging), the browser may display a 504 even though the PLC is responding correctly on its own port. Refer to Microsoft Learn - Unable to start debugging on the web server for guidance on resolving local port conflicts. Stop the conflicting IIS Application Pool and restart the browser.
- If a corporate proxy is configured in the Windows Internet options, the browser may send the request to the proxy instead of directly to the CPU. Bypass the proxy for the
192.168.5.*subnet by adding it to the proxy exceptions list.
User-Defined Web Pages: Path and Provider Configuration
The "specify the path of user defined web page folder" step in TIA Portal is the most common source of the 504 failure. The CPU acts as an HTTP gateway that retrieves each requested file from the configured path at request time on early firmware revisions, and from on-card memory after a compile-and-download on V2.0+. The failure modes are:
- Engineering path removed or moved. The HTML directory field stores an absolute path. If the project is moved to a new PC or the drive letter changes, TIA Portal will fail to recompile the page set. The previously transferred pages remain on the SIMATIC Memory Card, but if the card is swapped or the project is rebuilt, the new transfer fails silently and the web server falls back to a provider that returns 504.
- Path uses Windows long-path syntax or symlinks. The V2.0 web server compiler does not resolve symlinks or paths longer than 250 characters.
- Read-only or encrypted folder. BitLocker-encrypted folders or folders flagged with mandatory EDR labels will fail the compile.
Reset the user-defined pages cleanly:
- In TIA Portal, delete the entire user-defined web pages entry and recompile.
- Re-add the page set, pointing to a freshly created folder at
C:\Siemens\Webpages. - Copy the HTML/CSS/JS assets into that folder and verify the TIA Portal compile produces a Successfully compiled message.
- Download to the CPU and test the welcome page first.
Verification and Final Testing
After every change, run the following verification checklist. Document the pass/fail of each item.
| Item | Pass criterion | Tools |
|---|---|---|
| L3 ping | < 5 ms with no loss | ping, PRONETA |
| Standard welcome page | HTTP 200, Siemens header visible | Browser, curl |
| Login form | Form posts, cookie set | Browser DevTools |
| Tag browser | Displays configured DB tags | Diagnostics tab |
| User-defined home | Returns HTTP 200, no 504 | curl -v, browser |
| Multiple refreshes | No intermittent 504 | Browser auto-refresh 30 s |
| CPU diagnostic buffer | No web server errors | Online & Diagnostics > Diagnostic buffer |
Open the CPU diagnostic buffer in TIA Portal (Online > Online & Diagnostics > Diagnostic buffer) and confirm there are no entries of class Web server with error codes Invalid page provider path, Page set generation failed, or Internal web server error. These entries pinpoint the exact stage of the page set lifecycle that failed.
Common Pitfalls and Field-Proven Caveats
-
Switching the engineering PC's subnet. Users often keep the PC on the office subnet (
192.168.0.x) and add a secondary IP for the PLC subnet (192.168.5.x). Windows then routes outgoing packets through the primary adapter. Force the metric on the PLC adapter to 1 in TCP/IP Advanced. - CPU behind a managed switch with port security. The first ARP from the PC is dropped, the CPU never replies, and the browser eventually shows 504. Disable port security on the PLC port or statically allow the PC's MAC.
- Self-signed certificate after HTTPS activation. A browser that does not trust the certificate may display a generic error that the user reads as "timeout". Add the certificate or switch to HTTP for diagnostic access.
- Page set generated by a newer TIA Portal version than the firmware supports. TIA Portal V17 page sets use script features (for example, ES6 syntax) that V2.0 cannot parse. The transfer completes but every page returns 504 because the embedded parser fails.
- Corrupted page set on the SIMATIC Memory Card. After a power loss during a web server download, the card may contain a partially written page set. Delete the page set via Online > Online & Diagnostics > Web server > Delete user-defined pages and re-transfer.
Escalation Path
If the standard welcome page loads but the user-defined page set continues to return 504, escalate through the following steps before opening a Siemens support request:
- Capture a Wireshark trace on the PC while reproducing the failure. Filter on
ip.addr == 192.168.5.144. Confirm the TCP handshake completes and the HTTP GET is sent. - Export the CPU diagnostic buffer as a text file (Online > Diagnostic buffer > Save as text).
- Save the TIA Portal project as a compressed archive.
- Open a support request on the Siemens Industry Online Support portal and attach the Wireshark capture, the diagnostic buffer export, and the project archive. Reference the CPU article number (
6ES7515-2FM02-0AB0), firmware version (V2.0), and the entry IDs for the manuals cited above.
FAQ
Why does my S7-1500 web server return 504 Gateway Timeout only for user-defined pages but the standard welcome page works?
The embedded web server uses the standard page set compiled into the firmware as a fallback, but treats the user-defined page set as an external page provider. When the provider path is unreachable, contains malformed AWP tags, or the page set was generated by an incompatible TIA Portal version, the embedded parser stalls and the CPU responds with 504 after the 30-second internal timeout. Disable user-defined pages first to confirm the standard pages load, then rebuild the page set against firmware V2.0-compatible TIA Portal.
Does the S7-1500 CPU 1515F-2 PN firmware V2.0 support HTTPS and modern browsers?
Firmware V2.0 supports HTTPS on TCP/443 with a self-signed certificate, but the validated browser list is restricted to Internet Explorer 11, Firefox ESR 52-60, and Chrome up to version 65. For modern Chrome, Firefox, or Edge, upgrade the CPU to firmware V2.6 or later and update the F-library if the controller is in a safety program.
I can ping the CPU at 192.168.5.144 but still get 504 in the browser. What is wrong?
Ping confirms L3 reachability only; the web server may still be unable to reply because the CPU's own IPv4 router entry is missing or because the page provider path is invalid. Clear the browser cache, restart the CPU web server from TIA Portal (Online > Online & Diagnostics > Web server > Restart), and check the diagnostic buffer for web server class events.
Can I store the user-defined web page folder on a network share or mapped drive?
No. Firmware V2.0 of the CPU 1515F-2 PN only supports local absolute paths (for example, C:\Siemens\Webpages). UNC paths and mapped drives are not resolved by the embedded compiler, and the transfer fails silently, resulting in a 504 response at runtime.
Will disabling and re-enabling the web server in TIA Portal force a clean state?
Yes. Uncheck Enable web server on this CPU, recompile, download, then re-check it, recompile, and download again. This forces the CPU to drop any cached page provider state. If the issue persists after this cycle, delete the user-defined page set entry entirely and recreate it from a freshly created local folder.