मेरे पास एक अपाचे सर्वर है जो हमारे डीएमजेड में रिवर्स प्रॉक्सी के रूप में काम करता है। हमारे पास एक बाहरी सेवा है जो इस सर्वर पर किसी विशेष यूआरएल पर पोस्ट करती है। इस सेवा के लिए पूरी तरह से नए एप्लिकेशन पर पोस्टबैक करने की आवश्यकता है, लेकिन यह निकट भविष्य में फिर से बदल जाएगा क्योंकि हम अभी एक परीक्षण चरण में हैं।अपाचे रिवाइट फिर प्रॉक्सी पास
तो इसे हल करने के लिए, मैं आने वाले पोस्टबैक अनुरोध, /smsPostback.php
को लेने की कोशिश कर रहा हूं, और इसे एक नए सापेक्ष यूआरएल, /SMSHandler/Process
पर फिर से लिखना चाहता हूं। यह हिस्सा काम कर रहा है।
हालांकि कॉन्फ़िगरेशन में तुरंत नीचे परिभाषित किया गया है, मेरे पास एक आंतरिक सर्वर पर /SMSHandler
पर सभी ट्रैफ़िक प्रॉक्सी करने के लिए प्रॉक्सीपास निर्देश है।
ये अपाचे conf फ़ाइल से नई लाइनें हैं:
RewriteRule ^/smsPostback.php$ /SMSHandler/Process
##Proxy pass smshandler
ProxyPass /SMSHandler http://172.29.61.49:8080/SMSHandler
ProxyPassReverse /SMSHandler http://172.29.61.49:8080/SMSHandler
और ये फिर से लिखने लॉग से लॉग हैं:
172.29.61.49 - - [24/Jan/2012:18:43:36 --0500] [test.hidden.com/sid#5eace0][rid#446b770/initial] (2) init rewrite engine with requested uri /smsPostback.php
172.29.61.49 - - [24/Jan/2012:18:43:36 --0500] [test.hidden.com/sid#5eace0][rid#446b770/initial] (3) applying pattern '^/smsPostback.php$' to uri '/smsPostback.php'
172.29.61.49 - - [24/Jan/2012:18:43:36 --0500] [test.hidden.com/sid#5eace0][rid#446b770/initial] (2) rewrite '/smsPostback.php' -> '/SMSHandler/Process'
172.29.61.49 - - [24/Jan/2012:18:43:36 --0500] [test.hidden.com/sid#5eace0][rid#446b770/initial] (2) local path result: /SMSHandler/Process
172.29.61.49 - - [24/Jan/2012:18:43:36 --0500] [test.hidden.com/sid#5eace0][rid#446b770/initial] (2) prefixed with document_root to C:/hidden.com/SMSHandler/Process
172.29.61.49 - - [24/Jan/2012:18:43:36 --0500] [test.hidden.com/sid#5eace0][rid#446b770/initial] (1) go-ahead with C:/hidden.com/SMSHandler/Process [OK]
और यह अपाचे से त्रुटि लॉग प्रविष्टि है:
[Tue Jan 24 18:43:36 2012] [error] [client 172.29.61.49] File does not exist: C:/fmfacilitymaintenance.com/SMSHandler
किसी भी विचार के कारण यह कभी भी अनुरोध को प्रॉक्सी नहीं करता है, बल्कि कोशिश करता है (और विफल रहता है) इसे स्थानीय रूप से सेवा दें ?? धन्यवाद!
धन्यवाद जॉन! उसने ऐसा किया! – Matt
आप 'अंतिम' को छोड़ सकते हैं, यह Passthrough के साथ निहित है http://httpd.apache.org/docs/2.2/rewrite/flags.html#flag_pt – oberhamsi