# Configuring the proxy server
The Tomcat platform uses [nginx](https://www.nginx.com/) (the default) or [Apache HTTP Server](https://httpd.apache.org/) as the reverse proxy to relay requests from port 80 on the instance to your Tomcat web container listening on port 8080. Elastic Beanstalk provides a default proxy configuration that you can extend or override completely with your own configuration.
**Configuring the proxy server on your platform version**
All AL2023/AL2 platforms support a uniform proxy configuration feature. For more information about configuring the proxy server on your platform versions running AL2023/AL2, see [Reverse proxy configuration](platforms-linux-extend.proxy.md).
## Configuring the proxy on the Amazon Linux AMI (preceding Amazon Linux 2) Tomcat platform
If your Elastic Beanstalk Tomcat environment uses an Amazon Linux AMI platform version (preceding Amazon Linux 2), read the additional information in this section.
**Notes**
The information in this topic only applies to platform branches based on Amazon Linux AMI (AL1). AL2023/AL2 platform branches are incompatible with previous Amazon Linux AMI (AL1) platform versions and *require different configuration settings*.
On [July 18, 2022](https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2022年07月18日-linux-al1-retire.html), Elastic Beanstalk set the status of all platform branches based on Amazon Linux AMI (AL1) to **retired**. For more information about migrating to a current and fully supported Amazon Linux 2023 platform branch, see [Migrating your Elastic Beanstalk Linux application to Amazon Linux 2023 or Amazon Linux 2](using-features.migration-al.md).
### Choosing a proxy server for your Tomcat environment — Amazon Linux AMI (AL1)
Tomcat platform versions based on Amazon Linux AMI (preceding Amazon Linux 2) use [Apache 2.4](https://httpd.apache.org/docs/2.4/) for the proxy by default. You can choose to use [Apache 2.2](https://httpd.apache.org/docs/2.2/) or [nginx](https://www.nginx.com/) by including a [configuration file](ebextensions.md) in your source code. The following example configures Elastic Beanstalk to use nginx.
**Example .ebextensions/nginx-proxy.config**
```
option_settings:
aws:elasticbeanstalk:environment:proxy:
ProxyServer: nginx
```
### Migrating from Apache 2.2 to Apache 2.4 — Amazon Linux AMI (AL1)
If your application was developed for [Apache 2.2](https://httpd.apache.org/docs/2.2/), read this section to learn about migrating to [Apache 2.4](https://httpd.apache.org/docs/2.4/).
Starting with Tomcat platform version 3.0.0 configurations, which were released with the [Java with Tomcat platform update on May 24, 2018](https://aws.amazon.com/releasenotes/release-aws-elastic-beanstalk-platform-update-for-the-java-with-tomcat-platform-on-may-24-2018/), Apache 2.4 is the default proxy of the Tomcat platform. The Apache 2.4 `.conf` files are mostly, but not entirely, backward compatible with those of Apache 2.2. Elastic Beanstalk includes default `.conf` files that work correctly with each Apache version. If your application doesn't customize Apache's configuration, as explained in [Extending and overriding the default Apache configuration — Amazon Linux AMI (AL1)](#java-tomcat-proxy-apache), it should migrate to Apache 2.4 without any issues.
If your application extends or overrides Apache's configuration, you might have to make some changes to migrate to Apache 2.4. For more information, see [Upgrading to 2.4 from 2.2](https://httpd.apache.org/docs/current/upgrading.html) on *The Apache Software Foundation*'s site. As a temporary measure, until you successfully migrate to Apache 2.4, you can choose to use Apache 2.2 with your application by including the following [configuration file](ebextensions.md) in your source code.
**Example .ebextensions/apache-legacy-proxy.config**
```
option_settings:
aws:elasticbeanstalk:environment:proxy:
ProxyServer: apache/2.2
```
For a quick fix, you can also select the proxy server in the Elastic Beanstalk console.
**To select the proxy in your Tomcat environment in the Elastic Beanstalk console**
1. Open the [Elastic Beanstalk console](https://console.aws.amazon.com/elasticbeanstalk), and in the **Regions** list, select your AWS Region.
1. In the navigation pane, choose **Environments**, and then choose the name of your environment from the list.
1. In the navigation pane, choose **Configuration**.
1. In the **Updates, monitoring, and logging** configuration category, choose **Edit**.
1. For **Proxy server**, choose `Apache 2.2 (deprecated)`.
1. To save the changes choose **Apply** at the bottom of the page.

### Extending and overriding the default Apache configuration — Amazon Linux AMI (AL1)
You can extend the Elastic Beanstalk default Apache configuration with your additional configuration files. Alternatively, you can override the Elastic Beanstalk default Apache configuration completely.
**Note**
All Amazon Linux 2 platforms support a uniform proxy configuration feature. For details about configuring the proxy server on Tomcat platform versions running Amazon Linux 2, see [Reverse proxy configuration](platforms-linux-extend.proxy.md).
If you're migrating your Elastic Beanstalk application to an Amazon Linux 2 platform, be sure to also read the information in [Migrating your Elastic Beanstalk Linux application to Amazon Linux 2023 or Amazon Linux 2](using-features.migration-al.md).
To extend the Elastic Beanstalk default Apache configuration, add `.conf` configuration files to a folder named `.ebextensions/httpd/conf.d` in your application source bundle. The Elastic Beanstalk Apache configuration includes `.conf` files in this folder automatically.
```
~/workspace/my-app/
|-- .ebextensions
| -- httpd
| -- conf.d
| -- myconf.conf
| -- ssl.conf
-- index.jsp
```
For example, the following Apache 2.4 configuration adds a listener on port 5000.
**Example .ebextensions/httpd/conf.d/port5000.conf**
```
listen 5000