Have you ever been frustrated by having to log in to your Proxmox server every time you access it? I certainly was. So, I decided to find a way to extend the session timeout using Nginx Proxy Manager. In this guide, I’ll show you how you can do the same, keeping your sessions active longer and making your life a bit easier.
Why Extend Proxmox Session Timeout?
If you’re like me and use Proxmox through a reverse proxy like Nginx Proxy Manager, you might find it annoying to enter your login credentials frequently. By extending the session timeout, you can stay logged in to the Proxmox Web GUI for longer periods, enhancing your workflow efficiency.
Understanding the Nginx Proxy Manager Configuration
Nginx Proxy Manager is a convenient tool for managing your reverse proxy settings through a user-friendly interface. To extend the session timeout and ensure proper WebSocket support for Proxmox, we’ll need to adjust some settings in the Nginx Proxy Manager.
Setting the Proxy Headers
First, we need to ensure that the client’s IP and forwarded data are correctly passed through. You can do this by adding the following headers:
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
Configuring WebSocket Settings
Proxmox uses WebSocket connections for real-time updates. To support this, include these settings:
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
Setting Connection Timeouts
To prevent timeouts and keep the session alive longer, adjust the read and send timeouts:
proxy_read_timeout 36000s;
proxy_send_timeout 36000s;
Adjusting SSL for Self-Signed Certificates
If you’re using self-signed SSL certificates, you might need to disable SSL verification:
proxy_ssl_verify off;
Keeping the Connection Alive
To ensure the connection remains persistent and prevent disconnections, add these headers:
proxy_set_header Connection keep-alive;
proxy_set_header Keep-Alive timeout=30;
Ensuring Session Cookie Persistence
Maintain login sessions by ensuring session cookies are passed correctly:
proxy_cookie_path / "/; secure; HttpOnly; SameSite=None";
Optional: Preventing Connection Header Overwriting
To prevent the Connection
header from being overwritten, which ensures stability, you can include:
proxy_set_header Connection "";
Step-by-Step Guide to Implementing the Configuration
Now that we’ve gone over the configurations, let’s implement them step by step.
Step 1: Access Nginx Proxy Manager
First, log in to your Nginx Proxy Manager admin panel. If you’re not sure how to access it, you can usually reach it by navigating to http://<your-server-ip>:81
in your browser.
Step 2: Edit Your Proxmox Domain Proxy Host
Find the proxy host entry for your Proxmox server (e.g., proxmox.<your-domain>.com
) and click on it to edit.
Step 3: Add Custom Configuration
In the Custom Locations field, paste the entire block of code we discussed earlier:
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_read_timeout 36000s;
proxy_send_timeout 36000s;
proxy_ssl_verify off;
proxy_set_header Connection keep-alive;
proxy_set_header Keep-Alive timeout=30;
proxy_cookie_path / "/; secure; HttpOnly; SameSite=None";
proxy_set_header Connection "";
Step 4: Save and Test
Click Save to apply the changes. Then, test your Proxmox Web GUI to see if it remains accessible and keeps you logged in for extended periods.
Troubleshooting Common Issues
If you run into any issues, here are some common problems and their solutions.
Proxmox Web GUI Not Loading
If the Proxmox interface doesn’t load after applying the settings, double-check the configuration code for any typos or missing semicolons.
Still Getting Logged Out Frequently
If you’re still being logged out, ensure that the session cookies are being handled correctly. The proxy_cookie_path
directive is crucial for this.
Additional Tips
Here are some extra pointers to enhance your Proxmox and Nginx Proxy Manager experience.
Securing Your Connection
Always ensure your connections are secure, especially when exposing services like Proxmox over the internet. Use valid SSL certificates whenever possible.
Regular Backups
Before making significant changes, it’s wise to back up your Nginx Proxy Manager configurations and Proxmox settings.
By following these steps, you’ve not only extended your Proxmox session timeout but also improved your overall server management efficiency.
If you have any questions or run into issues, feel free to leave a comment below. I’m always happy to help out fellow enthusiasts!
Conclusion
Extending the session timeout for Proxmox using Nginx Proxy Manager is a straightforward process that can save you time and hassle. By adjusting a few settings, you can keep your sessions active longer and enjoy a smoother experience managing your virtual environments.
Thank you for reading, and I hope this guide has been helpful. Happy computing!