質問編集履歴
2
原因部分のコードが書かれていなかったため
test
CHANGED
File without changes
|
test
CHANGED
@@ -32,9 +32,9 @@
|
|
32
32
|
|
33
33
|
|
34
34
|
|
35
|
+
app.py
|
36
|
+
|
35
37
|
```python
|
36
|
-
|
37
|
-
#app.py
|
38
38
|
|
39
39
|
from flask import *
|
40
40
|
|
@@ -60,17 +60,13 @@
|
|
60
60
|
|
61
61
|
```
|
62
62
|
|
63
|
+
index.cgi
|
63
64
|
|
64
|
-
|
65
|
-
```
|
65
|
+
```python
|
66
66
|
|
67
67
|
|
68
68
|
|
69
|
-
|
70
|
-
|
71
69
|
#!/usr/local/bin/python3.7
|
72
|
-
|
73
|
-
#index.cgi
|
74
70
|
|
75
71
|
import cgitb
|
76
72
|
|
@@ -84,15 +80,43 @@
|
|
84
80
|
|
85
81
|
|
86
82
|
|
83
|
+
class ProxyFix(object):
|
84
|
+
|
85
|
+
def __init__(self, app):
|
86
|
+
|
87
|
+
self.app = app
|
88
|
+
|
89
|
+
def __call__(self, environ, start_response):
|
90
|
+
|
91
|
+
environ['SERVER_NAME'] = (サーバー名)
|
92
|
+
|
93
|
+
environ['SERVER_PORT'] = "80"
|
94
|
+
|
95
|
+
environ['REQUEST_METHOD'] = "GET"
|
96
|
+
|
97
|
+
environ['SCRIPT_NAME'] = ""
|
98
|
+
|
99
|
+
environ['PATH_INFO'] = "/"
|
100
|
+
|
101
|
+
environ['QUERY_STRING'] = ""
|
102
|
+
|
103
|
+
environ['SERVER_PROTOCOL'] = "HTTP/1.1"
|
104
|
+
|
105
|
+
return self.app(environ, start_response)
|
106
|
+
|
107
|
+
|
108
|
+
|
87
109
|
if __name__ == '__main__':
|
110
|
+
|
111
|
+
app.wsgi_app = ProxyFix(app.wsgi_app)
|
88
112
|
|
89
113
|
CGIHandler().run(app)
|
90
114
|
|
91
115
|
```
|
92
116
|
|
117
|
+
.htaccess
|
93
118
|
|
94
|
-
|
95
|
-
```
|
119
|
+
```apache
|
96
120
|
|
97
121
|
RewriteEngine On
|
98
122
|
|
1
Apacheタグを追加しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -122,7 +122,7 @@
|
|
122
122
|
|
123
123
|
(サーバーのURL)/test
|
124
124
|
|
125
|
-
では”Test World"と表示してほしいと思っています。
|
125
|
+
では”Test World"と表示してほしいなぁと思っています。
|
126
126
|
|
127
127
|
|
128
128
|
|