We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
nginx configuration


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `fedireads/settings.py`
Content:
```
1 ''' fedireads settings and configuration '''
2 import os
3 
4 from environs import Env
5 
6 env = Env()
7 
8 # celery
9 CELERY_BROKER = env('CELERY_BROKER')
10 CELERY_RESULT_BACKEND = env('CELERY_RESULT_BACKEND')
11 CELERY_ACCEPT_CONTENT = ['application/json']
12 CELERY_TASK_SERIALIZER = 'json'
13 CELERY_RESULT_SERIALIZER = 'json'
14 
15 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
16 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17 
18 # Quick-start development settings - unsuitable for production
19 # See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
20 
21 # SECURITY WARNING: keep the secret key used in production secret!
22 SECRET_KEY = env('SECRET_KEY')
23 
24 # SECURITY WARNING: don't run with debug turned on in production!
25 DEBUG = env.bool('DEBUG', True)
26 
27 DOMAIN = env('DOMAIN')
28 ALLOWED_HOSTS = env.list('ALLOWED_HOSTS', ['*'])
29 OL_URL = env('OL_URL')
30 
31 # Application definition
32 
33 INSTALLED_APPS = [
34     'django.contrib.admin',
35     'django.contrib.auth',
36     'django.contrib.contenttypes',
37     'django.contrib.sessions',
38     'django.contrib.messages',
39     'django.contrib.staticfiles',
40     'django.contrib.humanize',
41     'fedireads',
42     'celery',
43 ]
44 
45 MIDDLEWARE = [
46     'django.middleware.security.SecurityMiddleware',
47     'django.contrib.sessions.middleware.SessionMiddleware',
48     'django.middleware.common.CommonMiddleware',
49     'django.middleware.csrf.CsrfViewMiddleware',
50     'django.contrib.auth.middleware.AuthenticationMiddleware',
51     'django.contrib.messages.middleware.MessageMiddleware',
52     'django.middleware.clickjacking.XFrameOptionsMiddleware',
53 ]
54 
55 ROOT_URLCONF = 'fedireads.urls'
56 
57 TEMPLATES = [
58     {
59         'BACKEND': 'django.template.backends.django.DjangoTemplates',
60         'DIRS': ['templates'],
61         'APP_DIRS': True,
62         'OPTIONS': {
63             'context_processors': [
64                 'django.template.context_processors.debug',
65                 'django.template.context_processors.request',
66                 'django.contrib.auth.context_processors.auth',
67                 'django.contrib.messages.context_processors.messages',
68             ],
69         },
70     },
71 ]
72 
73 
74 WSGI_APPLICATION = 'fedireads.wsgi.application'
75 
76 
77 # Database
78 # https://docs.djangoproject.com/en/2.0/ref/settings/#databases
79 
80 FEDIREADS_DATABASE_BACKEND = env('FEDIREADS_DATABASE_BACKEND', 'postgres')
81 
82 FEDIREADS_DBS = {
83     'postgres': {
84         'ENGINE': 'django.db.backends.postgresql_psycopg2',
85         'NAME': env('POSTGRES_DB', 'fedireads'),
86         'USER': env('POSTGRES_USER', 'fedireads'),
87         'PASSWORD': env('POSTGRES_PASSWORD', 'fedireads'),
88         'HOST': env('POSTGRES_HOST', ''),
89         'PORT': 5432
90     },
91     'sqlite': {
92         'ENGINE': 'django.db.backends.sqlite3',
93         'NAME': os.path.join(BASE_DIR, 'fedireads.db')
94     }
95 }
96 
97 DATABASES = {
98     'default': FEDIREADS_DBS[FEDIREADS_DATABASE_BACKEND]
99 }
100 
101 
102 LOGIN_URL = '/login/'
103 AUTH_USER_MODEL = 'fedireads.User'
104 
105 # Password validation
106 # https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators
107 
108 AUTH_PASSWORD_VALIDATORS = [
109     {
110         'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
111     },
112     {
113         'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
114     },
115     {
116         'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
117     },
118     {
119         'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
120     },
121 ]
122 
123 
124 # Internationalization
125 # https://docs.djangoproject.com/en/2.0/topics/i18n/
126 
127 LANGUAGE_CODE = 'en-us'
128 
129 TIME_ZONE = 'UTC'
130 
131 USE_I18N = True
132 
133 USE_L10N = True
134 
135 USE_TZ = True
136 
137 
138 # Static files (CSS, JavaScript, Images)
139 # https://docs.djangoproject.com/en/2.0/howto/static-files/
140 
141 STATIC_URL = '/static/'
142 MEDIA_URL = '/images/'
143 MEDIA_ROOT = os.path.join(BASE_DIR, env('MEDIA_ROOT', 'images/'))
144
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/fedireads/settings.py b/fedireads/settings.py
--- a/fedireads/settings.py
+++ b/fedireads/settings.py
@@ -138,6 +138,8 @@
 # Static files (CSS, JavaScript, Images)
 # https://docs.djangoproject.com/en/2.0/howto/static-files/
 
+PROJECT_DIR = os.path.dirname(os.path.abspath(__file__))
 STATIC_URL = '/static/'
+STATIC_ROOT = os.path.join(BASE_DIR, env('STATIC_ROOT', 'static'))
 MEDIA_URL = '/images/'
-MEDIA_ROOT = os.path.join(BASE_DIR, env('MEDIA_ROOT', 'images/'))
+MEDIA_ROOT = os.path.join(BASE_DIR, env('MEDIA_ROOT', 'images'))

{"golden_diff": "diff --git a/fedireads/settings.py b/fedireads/settings.py\n--- a/fedireads/settings.py\n+++ b/fedireads/settings.py\n@@ -138,6 +138,8 @@\n # Static files (CSS, JavaScript, Images)\n # https://docs.djangoproject.com/en/2.0/howto/static-files/\n \n+PROJECT_DIR = os.path.dirname(os.path.abspath(__file__))\n STATIC_URL = '/static/'\n+STATIC_ROOT = os.path.join(BASE_DIR, env('STATIC_ROOT', 'static'))\n MEDIA_URL = '/images/'\n-MEDIA_ROOT = os.path.join(BASE_DIR, env('MEDIA_ROOT', 'images/'))\n+MEDIA_ROOT = os.path.join(BASE_DIR, env('MEDIA_ROOT', 'images'))\n", "issue": "nginx configuration\n\n", "before_files": [{"content": "''' fedireads settings and configuration '''\nimport os\n\nfrom environs import Env\n\nenv = Env()\n\n# celery\nCELERY_BROKER = env('CELERY_BROKER')\nCELERY_RESULT_BACKEND = env('CELERY_RESULT_BACKEND')\nCELERY_ACCEPT_CONTENT = ['application/json']\nCELERY_TASK_SERIALIZER = 'json'\nCELERY_RESULT_SERIALIZER = 'json'\n\n# Build paths inside the project like this: os.path.join(BASE_DIR, ...)\nBASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\n\n# Quick-start development settings - unsuitable for production\n# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/\n\n# SECURITY WARNING: keep the secret key used in production secret!\nSECRET_KEY = env('SECRET_KEY')\n\n# SECURITY WARNING: don't run with debug turned on in production!\nDEBUG = env.bool('DEBUG', True)\n\nDOMAIN = env('DOMAIN')\nALLOWED_HOSTS = env.list('ALLOWED_HOSTS', ['*'])\nOL_URL = env('OL_URL')\n\n# Application definition\n\nINSTALLED_APPS = [\n    'django.contrib.admin',\n    'django.contrib.auth',\n    'django.contrib.contenttypes',\n    'django.contrib.sessions',\n    'django.contrib.messages',\n    'django.contrib.staticfiles',\n    'django.contrib.humanize',\n    'fedireads',\n    'celery',\n]\n\nMIDDLEWARE = [\n    'django.middleware.security.SecurityMiddleware',\n    'django.contrib.sessions.middleware.SessionMiddleware',\n    'django.middleware.common.CommonMiddleware',\n    'django.middleware.csrf.CsrfViewMiddleware',\n    'django.contrib.auth.middleware.AuthenticationMiddleware',\n    'django.contrib.messages.middleware.MessageMiddleware',\n    'django.middleware.clickjacking.XFrameOptionsMiddleware',\n]\n\nROOT_URLCONF = 'fedireads.urls'\n\nTEMPLATES = [\n    {\n        'BACKEND': 'django.template.backends.django.DjangoTemplates',\n        'DIRS': ['templates'],\n        'APP_DIRS': True,\n        'OPTIONS': {\n            'context_processors': [\n                'django.template.context_processors.debug',\n                'django.template.context_processors.request',\n                'django.contrib.auth.context_processors.auth',\n                'django.contrib.messages.context_processors.messages',\n            ],\n        },\n    },\n]\n\n\nWSGI_APPLICATION = 'fedireads.wsgi.application'\n\n\n# Database\n# https://docs.djangoproject.com/en/2.0/ref/settings/#databases\n\nFEDIREADS_DATABASE_BACKEND = env('FEDIREADS_DATABASE_BACKEND', 'postgres')\n\nFEDIREADS_DBS = {\n    'postgres': {\n        'ENGINE': 'django.db.backends.postgresql_psycopg2',\n        'NAME': env('POSTGRES_DB', 'fedireads'),\n        'USER': env('POSTGRES_USER', 'fedireads'),\n        'PASSWORD': env('POSTGRES_PASSWORD', 'fedireads'),\n        'HOST': env('POSTGRES_HOST', ''),\n        'PORT': 5432\n    },\n    'sqlite': {\n        'ENGINE': 'django.db.backends.sqlite3',\n        'NAME': os.path.join(BASE_DIR, 'fedireads.db')\n    }\n}\n\nDATABASES = {\n    'default': FEDIREADS_DBS[FEDIREADS_DATABASE_BACKEND]\n}\n\n\nLOGIN_URL = '/login/'\nAUTH_USER_MODEL = 'fedireads.User'\n\n# Password validation\n# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators\n\nAUTH_PASSWORD_VALIDATORS = [\n    {\n        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',\n    },\n    {\n        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',\n    },\n    {\n        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',\n    },\n    {\n        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',\n    },\n]\n\n\n# Internationalization\n# https://docs.djangoproject.com/en/2.0/topics/i18n/\n\nLANGUAGE_CODE = 'en-us'\n\nTIME_ZONE = 'UTC'\n\nUSE_I18N = True\n\nUSE_L10N = True\n\nUSE_TZ = True\n\n\n# Static files (CSS, JavaScript, Images)\n# https://docs.djangoproject.com/en/2.0/howto/static-files/\n\nSTATIC_URL = '/static/'\nMEDIA_URL = '/images/'\nMEDIA_ROOT = os.path.join(BASE_DIR, env('MEDIA_ROOT', 'images/'))\n", "path": "fedireads/settings.py"}], "after_files": [{"content": "''' fedireads settings and configuration '''\nimport os\n\nfrom environs import Env\n\nenv = Env()\n\n# celery\nCELERY_BROKER = env('CELERY_BROKER')\nCELERY_RESULT_BACKEND = env('CELERY_RESULT_BACKEND')\nCELERY_ACCEPT_CONTENT = ['application/json']\nCELERY_TASK_SERIALIZER = 'json'\nCELERY_RESULT_SERIALIZER = 'json'\n\n# Build paths inside the project like this: os.path.join(BASE_DIR, ...)\nBASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\n\n# Quick-start development settings - unsuitable for production\n# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/\n\n# SECURITY WARNING: keep the secret key used in production secret!\nSECRET_KEY = env('SECRET_KEY')\n\n# SECURITY WARNING: don't run with debug turned on in production!\nDEBUG = env.bool('DEBUG', True)\n\nDOMAIN = env('DOMAIN')\nALLOWED_HOSTS = env.list('ALLOWED_HOSTS', ['*'])\nOL_URL = env('OL_URL')\n\n# Application definition\n\nINSTALLED_APPS = [\n    'django.contrib.admin',\n    'django.contrib.auth',\n    'django.contrib.contenttypes',\n    'django.contrib.sessions',\n    'django.contrib.messages',\n    'django.contrib.staticfiles',\n    'django.contrib.humanize',\n    'fedireads',\n    'celery',\n]\n\nMIDDLEWARE = [\n    'django.middleware.security.SecurityMiddleware',\n    'django.contrib.sessions.middleware.SessionMiddleware',\n    'django.middleware.common.CommonMiddleware',\n    'django.middleware.csrf.CsrfViewMiddleware',\n    'django.contrib.auth.middleware.AuthenticationMiddleware',\n    'django.contrib.messages.middleware.MessageMiddleware',\n    'django.middleware.clickjacking.XFrameOptionsMiddleware',\n]\n\nROOT_URLCONF = 'fedireads.urls'\n\nTEMPLATES = [\n    {\n        'BACKEND': 'django.template.backends.django.DjangoTemplates',\n        'DIRS': ['templates'],\n        'APP_DIRS': True,\n        'OPTIONS': {\n            'context_processors': [\n                'django.template.context_processors.debug',\n                'django.template.context_processors.request',\n                'django.contrib.auth.context_processors.auth',\n                'django.contrib.messages.context_processors.messages',\n            ],\n        },\n    },\n]\n\n\nWSGI_APPLICATION = 'fedireads.wsgi.application'\n\n\n# Database\n# https://docs.djangoproject.com/en/2.0/ref/settings/#databases\n\nFEDIREADS_DATABASE_BACKEND = env('FEDIREADS_DATABASE_BACKEND', 'postgres')\n\nFEDIREADS_DBS = {\n    'postgres': {\n        'ENGINE': 'django.db.backends.postgresql_psycopg2',\n        'NAME': env('POSTGRES_DB', 'fedireads'),\n        'USER': env('POSTGRES_USER', 'fedireads'),\n        'PASSWORD': env('POSTGRES_PASSWORD', 'fedireads'),\n        'HOST': env('POSTGRES_HOST', ''),\n        'PORT': 5432\n    },\n    'sqlite': {\n        'ENGINE': 'django.db.backends.sqlite3',\n        'NAME': os.path.join(BASE_DIR, 'fedireads.db')\n    }\n}\n\nDATABASES = {\n    'default': FEDIREADS_DBS[FEDIREADS_DATABASE_BACKEND]\n}\n\n\nLOGIN_URL = '/login/'\nAUTH_USER_MODEL = 'fedireads.User'\n\n# Password validation\n# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators\n\nAUTH_PASSWORD_VALIDATORS = [\n    {\n        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',\n    },\n    {\n        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',\n    },\n    {\n        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',\n    },\n    {\n        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',\n    },\n]\n\n\n# Internationalization\n# https://docs.djangoproject.com/en/2.0/topics/i18n/\n\nLANGUAGE_CODE = 'en-us'\n\nTIME_ZONE = 'UTC'\n\nUSE_I18N = True\n\nUSE_L10N = True\n\nUSE_TZ = True\n\n\n# Static files (CSS, JavaScript, Images)\n# https://docs.djangoproject.com/en/2.0/howto/static-files/\n\nPROJECT_DIR = os.path.dirname(os.path.abspath(__file__))\nSTATIC_URL = '/static/'\nSTATIC_ROOT = os.path.join(BASE_DIR, env('STATIC_ROOT', 'static'))\nMEDIA_URL = '/images/'\nMEDIA_ROOT = os.path.join(BASE_DIR, env('MEDIA_ROOT', 'images'))\n", "path": "fedireads/settings.py"}]}