<-
Apache > HTTP Server > Documentation > Version 2.4 > ���

����ġ ��� mod_headers

������ ���:  en  |  fr  |  ja  |  ko 

�� ������ �ֽ��� ������ �ƴմϴ�. �ֱٿ� ����� ������ ���� ������ �����ϼ���.
����:HTTP ��û ����� ���� ��� ����
����:Extension
����:headers_module
�ҽ�����:mod_headers.c
����:RequestHeader�� ����ġ 2.0���� �ִ�

���

�� ����� HTTP ��û ����� ���� ����� �����ϰ� �����ϴ� ���þ���� �����Ѵ�. ����� ��ġ�ų� ��ü, ������ �� �ִ�.

���þ��

����

top

ó�� ����

mod_headers�� �����ϴ� ���þ�� ���������� ���� ��� ��ҿ��� ����� �� ������, ���� �������� ���μ� ���þ��� ������ ������ ���� �ִ�.

ó�������� �߿��ϸ�, �������Ͽ� ���� ������ ���� ������ ������ �޴´�. ���� �� ���þ �ݴ�� ������ ȿ���� �޶�����.

RequestHeader append MirrorID "mirror 12"
RequestHeader unset MirrorID

���� ���� ������ MirrorID ����� ������ �ʴ´�. �ݴ�� ������ MirrorID ����� "mirror 12"�� �����Ѵ�.

top

�̸�(early) ó���� ����(late) ó��

mod_headers�� ��û �ʱ⳪ ���߿� ������ �� �ִ�. ������ ��������ڸ� �����ϱ� ������ ��û ����� �����ϰ� ������ ��Ʈ���� ���� ���� ����� �����ϴ� ����(late) ����� ����Ѵ�. ���� �����ϴ� ���������� �׻� ���� ����� ����϶�.

�̸�(early) ����� �����ڸ� ���� �˻�/���������� �������. early Ű���带 ����Ͽ� ������ ���þ�� ��û�� ó���ϱ� �����Ҷ� �����Ѵ�. ��, �ٸ� ��û�� ���ǽ����ϰų� �˻縦 �ϱ����� ����� �� ������, ������ �����ϱ� ���� �ٸ� ����� �ҽÿ� ����� ������ �� �ִ�.

��û��ο� ���� ������ ���캸�� ���� �̸� ���þ ó���ϱ⶧���� �̸� ��� ���þ�� �ּ����̳� ����ȣ��Ʈ �����ҿ����� ����� �� �ִ�. �̸� ���þ�� ��û��ο� ������ �� ���⶧���� <Directory>�� <Location>���� �����ҿ��� ����� �� ����.

top

����

  1. "TS"�� �����ϴ� ��� ��û ����� ���� ����� �����Ѵ�.

    Header echo ^TS

  2. ���信 ��û�� ���� �ð��� ��û�� �����ϴµ� �ɸ� �ð��� �˷��ִ� MyHeader ����� �߰��Ѵ�. Ŭ���̾�Ʈ�� �� ����� ���� ������ ���ϸ� �����ϰų� Ŭ���̾�Ʈ�� �������� �������� ã�� �� �ִ�.

    Header add MyHeader "%D %t"

    ���信 ������ ���� ����� �����.

    MyHeader: D=3775428 t=991424704447256

  3. Joe���� �ȳ�

    Header add MyHeader "Hello Joe. It took %D microseconds \
    for Apache to serve this request."

    ���信 ������ ���� ����� �����.

    MyHeader: Hello Joe. It took D=3775428 microseconds for Apache to serve this request.

  4. ��û�� "MyRequestHeader" ����� �ִ� ��쿡�� ���������� ���信 MyHeader�� ������. Ư�� Ŭ���̾�Ʈ���Ը� ���信 ����� �߰��Ҷ� �����ϴ�. �� ������ �����Ϸ��� mod_setenvif ����� �ʿ��ϴ�.

    SetEnvIf MyRequestHeader value HAVE_MyRequestHeader
    Header add MyHeader "%D %t mytext" env=HAVE_MyRequestHeader

    HTTP ��û�� MyRequestHeader: value ����� �ִٸ�, ���信 ������ ���� ����� �����.

    MyHeader: D=3775428 t=991424704447256 mytext

top

Header ���þ�

����:HTTP ���� ����� �����Ѵ�
����:Header [condition] set|append|add|unset|echo header [value] [early|env=[!]variable]
������:�ּ�������, ����ȣ��Ʈ, directory, .htaccess
Override �ɼ�:FileInfo
����:Extension
���:mod_headers

�� ���þ�� HTTP ���� ����� ��ġ�ų� ��ü, �����Ѵ�. ���� �ڵ鷯�� ��� ���Ͱ� ������ ���Ŀ� ����� �����ϱ⶧���� ���� ����� ������ �� �ִ�.

condition�� ���������� ����ϸ�, ������ onsuccess Ȥ�� always�� ����Ѵ�. �̴� � ���� ���ǥ�� ���������� �����Ѵ�. onsuccess�� 2xx �����ڵ带 ���ϰ�, always�� (2xx�� ������) ��� �����ڵ带 ���Ѵ�. Ư�� � ����� ������ ����� �����ϰ� �ʹٸ�, ���� � ���� ������� �� ������� �Ѵ�.

�ι�° �ƱԸ�Ʈ�� ���� ����� �ٸ���. �ι�° �ƱԸ�Ʈ�� �Ʒ� ���� �ϳ��� ����� �� �ִ�.

set
���� ����� �����Ѵ�. ���� �̸����� �̹� ����� �ִٸ� ��ü�Ѵ�. value�� ���Ĺ��ڿ��� ����� �� �ִ�.
append
�̹� �����ϴ� ���� �̸��� ���� ����� �߰��Ѵ�. ���� ����� ���ο� ���� ��ġ��, ���� ����� ���ο� �� ���̿� ��ǥ�� ���δ�. �̴� ���� ������� �����ϴ� HTTP ǥ�� ����̴�.
add
����� �̹� �ִ��� ���� ����� �߰��Ѵ�. �׷��� ���� �̸��� ����� �ΰ� (Ȥ�� ����) ���� �� �ִ�. �� ��� �ǿ��� ����� �߻��� �� �ֱ⶧���� ���� ��� append�� ����ؾ� �Ѵ�.
unset
�̷� �̸��� ���� ����� �ִٸ� �����Ѵ�. ���� �̸��� ���� ����� ������ �ִٸ� ��� �����Ѵ�. value�� ���� �ʴ´�.
echo
�̷� �̸��� ��û ����� �״�� ���� ����� ������. header�� ����ǥ������ ����� �� �ִ�. value�� ���� �ʴ´�.

�ƱԸ�Ʈ �ڿ� header �̸��� ���´�. ����� �ڿ� �ݷ��� ���� �� ������, ��� �ȴ�. set, append, add, unset���� ��ҹ��ڴ� �����Ѵ�. echo�� header �̸��� ������ڸ� �����ϰ� ����ǥ������ ����� �� �ִ�.

add, append, set�� ����Ҷ��� ����° �ƱԸ�Ʈ value�� �ʿ��ϴ�. value �ȿ� ������ �ִٸ� �ֵ���ǥ�� ����� �Ѵ�. value�� �Ϲ� ���ڿ��̳� ������ ����ϴ� ���ڿ��̸�, �ΰ����� ���� ����� ���� �ִ�. value���� �����ϴ� ���ı���ڴ� ������ ����.

��������
%% �ۼ�Ʈ ��ȣ
%t ��û�� ���� �ð��� ����ǥ�ؽ÷� epoch (1970�� 1�� 1��) ���� ���� ����ũ���� ������. �� �տ� t=�� �ٴ´�.
%D ��û�� ���� �ð����� ����� ��Ʈ���� �������� �ɸ� �ð�. ��û�� �Ⱓ�� ���. �� �տ� D=�� �ٴ´�.
%{FOOBAR}e ȯ�溯�� FOOBAR�� ����.
%{FOOBAR}s mod_ssl�� �����Ѵٸ�, SSL ȯ�溯�� FOOBAR�� ����.

����

%s ���� �����ڴ� ����ġ 2.1 ���Ŀ��� �ִ�. �� �����ڴ� SSLOptions +StdEnvVars�� ����ϴ� �δ��� �������� %e ��� ����� �� �ִ�. � ���������� SSLOptions +StdEnvVars�� ����ؾ� �Ѵٸ�, %e�� %s ���� �ξ� �� ȿ�����̴�.

Header ���þ� �ڿ� �ൿ�� �Ͼ ������ �����ϴ� �߰� �ƱԸ�Ʈ�� �̸� ó���� ���ϴ� Ű���� early�� ���� �� �ִ�. env=... �ƱԸ�Ʈ�� ����� ��� �ش� ȯ�溯���� �����Ѵٸ� (Ȥ�� env=!...�� ���� ȯ�溯���� �������� �ʴٸ�) Header ���þ �����Ѵ�. �׷��� ������ ���þ�� ��û�� �ƹ� ������ ��ġ�� �ʴ´�.

�̸� ����� �ƴ϶�� ������ ��Ʈ������ ������ ������ Header ���þ ó���Ѵ�. �׷��� ��� ���Ͱ� �߰��ϴ� ����� ������ ��κ��� ����� �����ϰų� ��� �� �ִ�.

top

RequestHeader ���þ�

����:HTTP ��û ����� �����Ѵ�
����:RequestHeader set|append|add|unset header [value] [early|env=[!]variable]
������:�ּ�������, ����ȣ��Ʈ, directory, .htaccess
Override �ɼ�:FileInfo
����:Extension
���:mod_headers

�� ���þ�� HTTP ��û ����� ��ġ�ų� ��ü, �����Ѵ�. ���� �ڵ鷯�� �����ϱ� ������ ����� �����ϱ⶧���� ���� ����� ������ �� �ִ�. ù��° �ƱԸ�Ʈ�� ���� ����� �ٸ���. ù��° �ƱԸ�Ʈ�� �Ʒ� ���� �ϳ��� ����� �� �ִ�.

set
��û ����� �����Ѵ�. ���� �̸����� �̹� ����� �ִٸ� ��ü�Ѵ�
append
�̹� �����ϴ� ���� �̸��� ��û ����� �߰��Ѵ�. ���� ����� ���ο� ���� ��ġ��, ���� ����� ���ο� �� ���̿� ��ǥ�� ���δ�. �̴� ���� ������� �����ϴ� HTTP ǥ�� ����̴�.
add
����� �̹� �ִ��� ��û ����� �߰��Ѵ�. �׷��� ���� �̸��� ����� �ΰ� (Ȥ�� ����) ���� �� �ִ�. �� ��� �ǿ��� ����� �߻��� �� �ֱ⶧���� ���� ��� append�� ����ؾ� �Ѵ�.
unset
�̷� �̸��� ��û ����� �ִٸ� �����Ѵ�. ���� �̸��� ���� ����� ������ �ִٸ� ��� �����Ѵ�. value�� ���� �ʴ´�.

�ƱԸ�Ʈ �ڿ� ������� ���´�. ����� �ڿ� �ݷ��� ���� �� ������, ��� �ȴ�. ��ҹ��ڴ� �����Ѵ�. add, append, set�� ����Ҷ��� ����° �ƱԸ�Ʈ value�� �ʿ��ϴ�. value �ȿ� ������ �ִٸ� �ֵ���ǥ�� ����� �Ѵ�. unset�� ����Ҷ��� value�� ������ �ȵȴ�. value�� �Ϲ� ���ڿ��̳� ������ ����ϴ� ���ڿ��̸�, �ΰ����� ���� ����� ���� �ִ�. �����ϴ� ���ı���ڴ� Header�� �����Ƿ� �ڼ��� ������ �װ��� �����϶�.

RequestHeader ���þ� �ڿ� �ൿ�� �Ͼ ������ �����ϴ� �߰� �ƱԸ�Ʈ�� �̸� ó���� ���ϴ� Ű���� early�� ���� �� �ִ�. env=... �ƱԸ�Ʈ�� ����� ��� �ش� ȯ�溯���� �����Ѵٸ� (Ȥ�� env=!...�� ���� ȯ�溯���� �������� �ʴٸ�) RequestHeader ���þ �����Ѵ�. �׷��� ������ ���þ�� ��û�� �ƹ� ������ ��ġ�� �ʴ´�.

�̸� ����� �ƴ϶�� fixup �ܰ迡�� ��û�� �ش��ϴ� �ڵ鷯�� �����ϱ� ������ RequestHeader ���þ ó���Ѵ�. �׷��� �������� ���� Ȥ�� ����ġ �Է����Ͱ� ����� ����ų� ������ �� �ִ�.

������ ���:  en  |  fr  |  ja  |  ko 

top

Comments

Notice:
This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our mailing lists.